Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animation on turn?

Rico Kappler
Registered User
Join date: 17 Apr 2007
Posts: 20
02-24-2009 21:09
hi everyone,

basically i build cars in sl, but im trying to learn new things to add to my scripts ,so basically what im trying to do is add a animation when i turn.so when you turn you would lean to the way your turning.

if this has bin posted from someone else im srry

any tips or suggestions would be appreciated

thanks rico
Tanith Rosenbaum
Registered User
Join date: 10 Sep 2008
Posts: 42
02-26-2009 05:27
Well, one (probably a bit lag-inducing) way to do it would be to have a timer event repeatedly call llGetObjectDetails() with OBJECT_ROT as parameter, store the result, and compare it with the next one. Any change signifies a rotation, and some magic with llRot2Euler() should give you an easily interpretable direction of the rotation.

Since you're building vehicles, another way would be to interpret the already tapped controls (CONTROL_ROT_LEFT and CONTROL_ROT_RIGHT) to determine user-initiated rotations. but of course that doesn't give you any physics induced direction changes, like your vehicle colliding with something.

I hope that helps.

Cheers
Tanith