
[ad_1]
I’m growing a first-person participant motion during which the participant ought to “fly” within the path of his native ahead vector.
This is working completely high quality, nevertheless, once I flip the participant to face different path (rotate the y rotation axis), the power that has been added until this level, retains considerably affecting the rigidbody so it strikes the thing in the direction of the mistaken path, and it takes a whole lot of rĂ©sistance power to maneuver in the direction of the “new” path I’m dealing with.
I’d optimally like to have a little bit of “drifting” have an effect on, so it maintains a practical contact.
I’m attempting to realize a conduct that’s just about equivalent to a automobile conduct, so when the thing is popping in the direction of a path, the thing will really virtually immediately transfer in the direction of this path, sustaining its present velocity.
To make it clearer, here is an illustration of the present conduct:
Here’s an illustration of the specified conduct:
This is the present code I’m utilizing:
//Add power up
playerRB.AddPressure(Vector3.up * wingForceUpMultiplier * forceUserInput, ForceMode.VelocityChange);
//Add power ahead
playerRB.AddPressure(forwardDirection * wingForceForwardMultiplier * forceUserInput, ForceMode.VelocityChange);
I’m not essentially searching for a complex-physics answer, it may be a easy workaround if there may be any.
[ad_2]