Jump to content
  • 0

llSetVelocity used on avatars screws up while colliding with things, please help!


Prototype Alpha
 Share

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

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

Question

I'm scripting an attachment hoverboard using llSetVelocity, and for some reason whenever I collide with a wall while facing it, it will lock my avatar from rotating, so while holding forward (for example) and turning left or right, my avatar will still keep moving into the wall in the direction it was facing when i first collided with it, rather than the new direction i am facing after rotating. So it basically turns all walls into a sticky deathtrap with infinite friction that you have to stop and back up off of in order to rotate and move in a new direction. As you could imagine, this is a horrendously awful issue i need to overcome if I want this hoverboard to work in a satisfactory manner (i hope it will surpass my last 2 hoverboards, which are practically the two top selling hoverboards on Marketplace). Worst-case scenario, I could try to use llApplyImpulse or llSetForce instead, but it would not work nearly as beautifully if I did. llSetVelocity allows for incredibly fluid control over avatar physics, allowing me to (in this case) apply a velocity falloff when starting/stopping movement so you don't just start/stop at full velocity instantaneously. Also, it rather-effectively negates ground and slope friction that would normally slow down avatar movement when using llApplyImpulse or llSetForce.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

It's hard to diagnose your problem without seeing how your script is written.  However, if I were scripting a hoverboard I would probably not use llSetVelocity at all. llSetVelocity will give you a constant velocity and will not allow you to change direction.  (Remember, velocity is a vector, not a scalar quantity like speed.) .  Instead, I would create the hoverboard as a vehicle and adjust its speed and direction in a control event by varying the vector parameters in

 llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <xMotor,0,zMotor>);

and

 llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);

That's a lot cleaner and it would give you fine, quick control over your direction and speed.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3470 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...