Im making a tribes style game (if you need context to my question) and i want you to be able to slightly control you direction when going at high speeds. The players rotation is independent of the direction you are going so i cant use the “side to side” axis. How should i go about this? Should i make an item that follows the players travelingdirection and base it on that or is there any other way. Like using rigidbody.velocity or something…
If I gather you are describing where, for instance the playing is running left, and can turn to the side while he continues to run along the same path leftward?
Is the motion being applied directly to the player, or is the player the child of an object that is producing the movement?
For stuff like that I drop the player in an empty object to apply velocities so that I can apply rotation to the character without it affecting directional speed. Thus the player can flop and rotate around all day under the controller object, while actual directional force is only applied to the controller.
you can “clip” the effect with an if statement to check the speed, and if I understand you correctly, turning radius decreases with speed? If that is the case you can you can divide your rotation factor by a portion of the velocity such as
//--Check to see if we're above 92 velocity--//
if(controllerObject.velocity.magnitude.normalized >= 92)
{
//--Decrease turning sp with increase in relation to velocity above 92--//
rotSpeed = rotSpeedBase / ((controllerObject.velocity.magnitude.normalized -92) / 5);
//--reset to normal turning sp when under target speed--/
}else
{rotSpeed = rotSpeedBase;}
Bear in mind, that you may need to check with some if statements to be sure that you don’t go under any problematic limits, like 0 when doing stuff like this.