Jump to content

How to make vehicle move sideways


Sunbleached
 Share

You are about to reply to a thread that has been inactive for 1252 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

It's not clear to me if you're wondering how to make an existing vehicle move sideways (you can't) or if you're trying to script one to do so. If the latter, you'd use llApplyImpulse as Profaitchikenz described, connected to the arrow keys using the following function...

http://wiki.secondlife.com/wiki/LlTakeControls

  • Like 1
Link to comment
Share on other sites

34 minutes ago, Madelaine McMasters said:

It's not clear to me if you're wondering how to make an existing vehicle move sideways (you can't) or if you're trying to script one to do so. If the latter, you'd use llApplyImpulse as Profaitchikenz described, connected to the arrow keys using the following function...

http://wiki.secondlife.com/wiki/LlTakeControls

Strange, isn't it obvious? The question is in lsl scripting category. Whats not clear? 

  • Confused 4
Link to comment
Share on other sites

If you're scripting the vehicle yourself, read the Linden Vehicle Tutorial.

See the part which discusses VEHICLE_LINEAR_MOTOR_DIRECTION.

llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <5, 0, 0>);

That <5,0,0> means 5 meters per second in the +X direction in vehicle coordinates, which is "forward".

To go sideways, you'd set some value like <0,2,0>, which would send you sideways (left) at 2 meters per second.

 

Now, if this is some existing vehicle that you're just driving, it will only go sideways on command if the creator put in code to make it go sideways. Most vehicles other than helicopters are not programmed to do that. It's entirely up to the creator of the vehicle how it works.

Link to comment
Share on other sites

5 hours ago, Sunbleached said:

Strange, isn't it obvious? The question is in lsl scripting category. Whats not clear? 

Recommend you visit @Jopsy Pendragon 's vehicle laboratory if you haven't already. 

The answer depends on how you have your motors and friction are set up, as you probably know by now. 

There is a lot of interplay between physics system parameters, as you have doubtless noticed. Under most scenarios, @Profaitchikenz Haiku 's answer is the way I would start. 

The fix you made for mouselook a few weeks ago undermines this objective if this is the same project. 

Edited by Desiree Moonwinder
Link to comment
Share on other sites

1 hour ago, animats said:

To go sideways, you'd set some value like <0,2,0>, which would send you sideways (left) at 2 meters per second.

Do you have experience changing motors' while steering?  I don't.  Does the change take effect fast enough?  A sideways impulse would work without switching the motor. 

Link to comment
Share on other sites

Let's just throw out random guesses about what's actually wanted here until we exhaust all the vehicle parameters and flags.

Here's one, for example, that's perfectly relevant to the question as asked: VEHICLE REFERENCE FRAME. Use that one before the vehicle starts and it'll move sideways forevermore, problem solved.

Except I bet that's not the problem. But it could be. (For that matter, we don't really know this is an actual Physical vehicle. Could be KFM. Could be old-school NPV. I was sorely tempted to make it "move sideways" with llSetRegionPos and declare victory.)

Link to comment
Share on other sites

Sun, if the vehicle is the plane that you were asking about yaw in a previous post then Qie has given you the answer here

19 hours ago, Qie Niangao said:

Here's one, for example, that's perfectly relevant to the question as asked: VEHICLE REFERENCE FRAME. Use that one

when VEHICLE_REFERENCE_FRAME is set to point at X (the default direction) we have to change VEHICLE_REFERENCE_FRAME to point at Y on (KeyDown & CONTROL_LEFT) and on (KeyDown & CONTROL_RIGHT)

to have the plane move sideways then the most intuitive method for the pilot is on (KeyPress & CONTROL_LEFT) apply a +value to linear_motor.x.  To move the other way then on (Keypress & CONTROL_RIGHT) apply a -value to linear_motor.x 

resetting VEHICLE_REFERENCE_FRAME to point at the default X on (KeyUp & CONTROL_LEFT) and on (KeyUp & CONTROL_RIGHT)

a new linear_motor variable is declared and used in the same way as the angular_motor variable in the cubey script

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1252 days.

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
 Share

×
×
  • Create New...