Raven Huntsman Posted January 6, 2022 Share Posted January 6, 2022 Hey guys, I'm a little stumped on the 'best' solution that is widely used by others for increasing an avatars movement speed (when on the ground) via a scripted attachment, in a stable manner. I've had a play with llSetForce/llApplyImpulse/llPushObject and in my testing, all of these suffer from an issue that I can only assume is the result of avatar to ground friction. I.e., llApplyImpulse(fwd * 100, FALSE) will only truly give me that level of force when I jump, shooting me off into the distance. I've tried adding small varied upwards forces to compensate against friction and this can work, in an unstable and difficult to control way. (You'd then have to start testing for when the avatar is airborn and disable impulse etc). My best attempt so far was using llSetVelocity, but this had some odd 'jumpy' results whereby the movement was not smooth, presumably due to friction and/or slightly unstable terrain. I've seen movement speed enhancers where the avatar plays some sprinting animation and the movement speed is increased without any of the above issues that I've observed, so i'm wondering if anyone knows how these are accomplished? What's the suggested method of removing avatar friction ? Changing the physics material doesn't seem to work for avis. Thank you Link to comment Share on other sites More sharing options...
Atomic Infinity Posted January 6, 2022 Share Posted January 6, 2022 llSetForce works for me but yes you do need to modify how much force to apply depending on if the avatar is on the ground or not. llGetAgentInfo will do that, you can check for AGENT_IN_AIR to determine if ground friction is in play. I find it returns very quickly so its not like it causes a significant delay. Though my workings with it are not about 'overcoming' the world physics, but rather modifying them to represent momentum and I do want it to be affected by the terrain, so I am not so much wanting a fast booster. Possible idea you could maybe set the avatar flying, then apply the forces (with down force if you want them to remain low), as that might overcome the jumpy nature of terrain and ground friction, though I didn't try that out. Link to comment Share on other sites More sharing options...
Mollymews Posted January 6, 2022 Share Posted January 6, 2022 (edited) i tend to llApplyImpulse in the control event the main thing is to multiply the desired velocity by the avatar's mass llAppyImpulse(desired_velocity * llGetMass(), TRUE); add link: http://wiki.secondlife.com/wiki/LlGetMass Edited January 6, 2022 by Mollymews Link to comment Share on other sites More sharing options...
Quistess Alpha Posted January 7, 2022 Share Posted January 7, 2022 (edited) If Your avatar might go into the air (for example, by jumping or flying) llMoveToPos() fixes a lot of issues. (There are much better ways to handle diagonal inputs .. .) Edited January 7, 2022 by Quistess Alpha Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now