Elijah Hutchence
Maker of the Blue Falcon
Join date: 7 Oct 2005
Posts: 14
|
01-17-2006 18:04
How can I propel my avatar in the direction I am facing using a script within an attached object? Anything I try absolutely refuses to work correctly.
I've tried to use llApplyImpulse/llSetForce with direction of llRot2Fwd(llGetRot()), but it doesn't work at all. I seems to go in a random direction. I've also tried to using llGetLocalRot() and llGetRootRotation, but neither work either.
So, in conclusion:
llApplyImpulse(llRot2Fwd(llGetRot())) llApplyImpulse(llRot2Fwd(llGetLocalRot())) llApplyImpulse(llRot2Fwd(llGetRootRotation())) llSetForce(llRot2Fwd(llGetRot())) llSetForce(llRot2Fwd(llGetLocalRot())) llSetForce(llRot2Fwd(llGetRootRotation()))
Do not work. None of them. They all send me in kooky directions. Yes, I didn't include the force amount applied, nor do I have the correct arguments, but that's just to show you all the different things I tried.
It seems llGetRot only returns the correct thing if you're in mouselook. Is this true? If so, that's incredibly stupid.
|
Preet Xavier
Registered User
Join date: 6 Dec 2004
Posts: 16
|
01-17-2006 19:22
llApplyImpulse has a second variable which determines whether your impulse vector is calculated based on where your avatar's facing, or relative to the grid. You'll want the former (TRUE).
I have to warn you that if you're trying to make your avatar walk or run faster, you'll have some work ahead of you. SL terrain has oodles of Coulomb friction, and the same amount of force that would send your avatar flying a mile into the air would not move your nearly as far forward if your feet were touching the ground.
|
Elijah Hutchence
Maker of the Blue Falcon
Join date: 7 Oct 2005
Posts: 14
|
01-17-2006 19:54
Well, it's basically supposed to be the Falcon Kick from Smash Brothers. He lights up on fire, flies forward, yells "Falcon Kick!" and knocks people in his way.
I'm not having trouble with anything else, really, it's just the rotation. And yeah, I have it many many times as high as my anti-gravity belt, which sends people straight up. I think it's at 50 times your mass, whereas the anti-grav belt matches gravity in m/s^2, so a setting of 9.8 defies gravity altogether.
Anyway, I'll try setting TRUE and let you know how it works.
|
Elijah Hutchence
Maker of the Blue Falcon
Join date: 7 Oct 2005
Posts: 14
|
01-17-2006 19:56
Here's exactly what I have (had, also), it doesn't send me forward.
llApplyImpulse(llRot2Fwd(llGetRot())*llGetMass()*50,TRUE);
|
Elijah Hutchence
Maker of the Blue Falcon
Join date: 7 Oct 2005
Posts: 14
|
01-17-2006 19:59
Oooh, yay!
On a hunch, I tried setting it to false (I've been using true the whole time) and it worked. I always get all those TRUE/FALSEs mixed up. Thanks for the help.
|