Tailsy Loxely Posted November 29, 2011 Share Posted November 29, 2011 Hello people! I was making an object today and thought of this cool idea! I wanted this certain object to float up and down like it was levitating! I'm having a hard time finding a script that would fit the bill! I hope someone can help me out! Thank you! 1 Link to comment Share on other sites More sharing options...
Thinkerer Melville Posted November 29, 2011 Share Posted November 29, 2011 Here are sources of free scripts: FOXSAN'S 3D TOOLS AND LSL SCRIPT REPOSITORY http://www.foxsan.com/scripts THE LSL SCRIPT DATABASE & LIBRARY http://www.free-lsl-scripts.com/ TKR Link to comment Share on other sites More sharing options...
conrad Evanier Posted November 30, 2011 Share Posted November 30, 2011 Hi Tailsy try this one out i have been messing about with it and got it to bob up and down in the air if thats what you're after float h=0.8; //the hight it bobs up you can change thisfloat m = 0.7; //0.1 slow bob 0.9 faster bob lolvector pos; float x=0; vector bob; default { state_entry() { llSetBuoyancy(1.0);llSetTimerEvent(0.5);pos=llGetPos() + <0,0,1.5>;llSetStatus(STATUS_PHANTOM , TRUE);llSetStatus(STATUS_PHYSICS , TRUE);} on_rez(integer start){ llResetScript();}timer(){ x+=m;bob = <0,0,llCos(x)*h>;llMoveToTarget(pos+bob,0.8);} } Link to comment Share on other sites More sharing options...
Ela Talaj Posted November 30, 2011 Share Posted November 30, 2011 Why does an object need to be physical to simply move up and down? Seems server load would be somewhat lighter if just using a regular non-physical object. llMoveToTarget() used to be more visually gracefull than llSetPos() because of 200 msec delay in the latter but since it is now possible to set position via llSetLinkPrimitiveParamFast() with no delay, it is no longer the case. Link to comment Share on other sites More sharing options...
conrad Evanier Posted November 30, 2011 Share Posted November 30, 2011 Good point Ela i tried llSetLinkPrimitiveParamFast() setpos, but doesn't look as smooth and floating as the physical version but if you played around you could get something similar. Now where did those boxs shoot off to that i got wrong lol Link to comment Share on other sites More sharing options...
Anton Catesby Posted November 30, 2011 Share Posted November 30, 2011 You might try playing with the new llSetKeyframedMotion. That's smoother than llSetPos and other non-physics motion (and a lot kinder on the sim). Link to comment Share on other sites More sharing options...
Miranda Umino Posted November 30, 2011 Share Posted November 30, 2011 It should be proved that llSetLinkPrimitiveParamsFast will be lighter in THIS paticular case Firstly , the prim doesn t need the collisions . So it s possible to filter out all collisions out with llColisionFilter. Secondly, there are several ways to move vertically : llSetBuoyancy with llMoveToTarget llSetHoverHeight and llStopHover llGroundRepel and the last llSetPhysicsMaterial( integer material_bits, float gravity_multiplier, float restitution, float friction, float density ) with a very low gravity , sometimes = 0 sometimes negative . You may change the density to change the mass of the object too ( sorry, the wiki page doesn t exist ) Each physical function has not the same weight to loead in the server . Probably i would avoid llMoveToTarget. llSetPhysicsMaterial is great : it consumes very few Energy even with a 64*64*64 prim If we just want the effect of levitation but we don t care with exactitude the final height , physics are great . It doesn t a linear movement with constant velocity and so it can be nicer to watch . To add , to have a smooth movement will llSetLinkPrimitiveParams you need to spam and to grow up the number of events per seconds . Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 30, 2011 Share Posted November 30, 2011 See the thread right next to this one in the LSL Scripting forum. In particular, look at Cerise's very simple example of a user defined function that makes use of llSetKeyframedMotion. The only thing you have to remember if you take this approach is that your object has to be defined in terms of the new Prim Equivalency system. That means adding llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); to your script before you call Cerise's function. 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