|
Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
|
06-22-2008 18:09
Is it possible to change the sit annimations according to the speed a vehicle is travelling - for example have a motor bike rider lower his crouch as the vehicle get faster then rise back up as it slows?
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-22-2008 20:52
Definitely. Just stop the current animation and start the new one. The logic you use to set the vehicle's linear motor parameter, or llVecMag(llGetVel()) in a timer, should give you a good value to use in choosing your animation.
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-22-2008 21:08
here is a little part of what i do for my one jetski should give you a jumpstart if havent started already animation() { moving=llGetVel(); float total = llVecMag(moving); if ((total < 2 && start == TRUE)) { llStopAnimation("avatar_jetski_sit2"); // stop the sit animation llStartAnimation("jetski_relax"); // start the relaxed animation } else if (total < 3) { } else if (total < 6) { llStopAnimation("jetski_relax"); // stop the relax animation llStartAnimation("avatar_jetski_sit2"); // start sit animation } else if (total < 9) { } else if (total < 12) { } else if (total < 15) { } else if (total < 18) { } else if (total > 17) { } }
//define it in timer
timer() { animation(); }
|
|
Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
|
06-22-2008 22:21
sqeals with delight - thank you!!
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
06-22-2008 23:02
From: Tuhfah Jecies sqeals with delight - thank you!! lol that amused me
|
|
Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
|
06-23-2008 00:29
got a problem - it must be staring me in the eyes - it seems to hiccup at this point (I'm just using any animations at this stage) if ((total < 2 && start == TRUE)) { llStopAnimation("Walk: Sexy"  ; // stop the sit animation llStartAnimation("displaystanding"  ; // start the relaxed animation } else if (total < 3) ..... I get 'Name not defined - Do we have to give a value for start somewhere?
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
06-23-2008 02:27
I recommend that you *first* start the new animation, then *stop* the old animation to get a smooth transition between the two.
|
|
Tuhfah Jecies
Registered User
Join date: 1 Jun 2008
Posts: 16
|
06-23-2008 03:15
Yep - thanks but I still cant get that script segment to work
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-23-2008 08:25
you dont need the start part
if (total < 2)
|