SerenaPufnstuf Posted December 9, 2020 Share Posted December 9, 2020 Hiiii All! Hope you can answer this odd query: Is it possible to write a script to detect the avatar reversing? I want to add a reversing beep to an av...just for a bit of fun! ty in advance! Hugs Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted December 9, 2020 Share Posted December 9, 2020 (edited) Yes and no. Put this in a box and wear it while moving: default { state_entry() { llSetTimerEvent(0.022); } timer() { vector v = llGetVel() / llGetRot(); vector color = <llFabs(v.x), llFabs(v.y), llFabs(v.z)>; llSetText((string)v, color, 1); } } It will display your avatar's velocity with hovertext, with the color matching the axis. (Red = X/forward/backward, Green = Y/left/right, Blue = Z/up/down) You'll notice that when you are walking backwards, the avatar turns around visually, making it look like the avatar is walking forward even when they're reversing. There's a viewer setting to disable that visual effect, but it doesn't make others see you like you're reversing and it doesn't tend to work with AOs. Edited December 9, 2020 by Wulfie Reanimator Link to comment Share on other sites More sharing options...
SerenaPufnstuf Posted December 9, 2020 Author Share Posted December 9, 2020 Thank you for that. I really need something that will play a sound in contents / uuid when the av is walking backwards ( i have the walking backwards anim). Just want it to play when that anim is playing. Hope that makes sense. ty Link to comment Share on other sites More sharing options...
Mollymews Posted December 10, 2020 Share Posted December 10, 2020 10 hours ago, SerenaPufnstuf said: Thank you for that. I really need something that will play a sound in contents / uuid when the av is walking backwards ( i have the walking backwards anim). Just want it to play when that anim is playing. Hope that makes sense. ty if you do what Wulfie says, put the script in a box and Wear the box then you will see that when moving forward vector v.x is positive, and vector v.x is negative when you move backwards so you put in a IF condition to play a sound when v.x is less than 0.0 Link to comment Share on other sites More sharing options...
SerenaPufnstuf Posted December 10, 2020 Author Share Posted December 10, 2020 Ah ty for the clarification. 🤗 1 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