Jump to content

AddTorque how to cancel it


YouGroove
 Share

Recommended Posts

I use AddTorque physics on some "vehicle" physic object.

The problem is AddTorque is almost continuous if you have some velocity going on.

I would like vehicle to stop turning one i don't turn no more, how to make some opposite force to Torque ?

 

How to cancel AddTorque ? No way to know the steering torque value ? No GetTorque available.

Stop toying and make games

Link to comment
Share on other sites

I think -entity:GetOmega() * entity:GetMass() * brakepower will do it, where brakepower is between 0 and 1. Maybe an easier way is to just set the omega (without the mass).

 

If you do use AddTorque() make sure you do it in the physics script function.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It works using SetOmega(), and to stop steering just use SetOmega with a Vec3(0,0,0).

 

---------------------------------

 

I will need GetOmega to progressively diminuish streering but it returns strange values.

 

Even when object is not turning and immobile Y value of GetOmega() remains at value 110 for example.

Same , turning vehicle in one direction only like left , values can go from positive to negavtive ?

Is it normal or a possible bug ?

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...