Answer the question
In order to leave comments, you need to log in
How to implement a 180 degree character rotation in Torque 3d?
Please help to implement the character reversal. Suspecting that it is necessary to edit the game\scripts\client\default.bind.cs file. But what values to set there, I can not imagine. The maximum he has achieved is that he makes a turn to the right by an insignificant value of a degree (barely noticeable).
Answer the question
In order to leave comments, you need to log in
A simple way to do this is the player transform.
Get player rotation or transform and do rotation +-180 degrees.
Torque script step in radians, you can have a value between 0 and 2PI.
Conversion help: (equivalence decimal)
0 radians = -2PI radians.
PI radians = -3PI/2 radians.
example: (z 180 degree rotation)
%objTransform = %object.getTransform();
%tryRotation = "0 0 0 0 0 1 " @ mDegToRad(180);
%newTransform = matrixMultiply(%objTransform, %tryRotation);
%object.setTransform(%newTransform);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question