Stride Forums Archive

[Solved] Apply Torque Local Angle

2 posts, 1644 views, 2018-08-28 to 2018-08-29

Domske 2018-08-28 #1

How to add torque to the local rotation of a entity?

This is global:

WheelRigidbody.ApplyTorque(Vector3.UnitX * 10);

This does not work correctly:

WheelRigidbody.ApplyTorque(Vector3.Normalize(WheelEntity.Transform.Rotation.Axis) * 10);

Maybe add 90 degrees. … I can’t solve it.

Background: Car physics.

Domske 2018-08-29 #2

Solution:

rigidBody.ApplyTorque( Entity.Transform.LocalMatrix.Left * 10);

btw. 10 is just the strength of the force.