By Johan Bichel Lindegaard / Sophie Zhu

Interactive 3D content developer, programmer and designer. Helping Tagging Art understand Second Life.

Physics

“I need to create some objects in SL which have an interactive function so that if an avatar gets within a certain distance to the object the object will move a bit away from the avatar. I have tried to apply a force to the object by scripting: bounce the object up in the air couldn’t make it work.”

You have an easy option to do non physical movement through llSetPos(llGetPos() + vector increment); However if you need smooth and dynamic movement you need to utilitize the physics engine as you already tryed yourself. There is a lot of difrent physical functions you can use and they all rely on the energy stored in the object. Everytime a physical function is called the object uses energy and the heavier the object is the more energy is used.

Here is all the physic functions you can use, play around with it. http://wiki.secondlife.com/wiki/Category:LSL_Physics

Remember to set physic state to TRUE, and if youre object is too heavy to respond to your impulse try using difrent kind of functions simultaneusly. You can in example set a force equal to the mass of the object multiplied 8.9. That will make the object weightless and make your impulse have a whole new meaning.

Post a Comment

You must be logged in to post a comment.