i want my player to slide down a slope fast enough to land on the other platform.
Problems:
-
I tried using addForce and also changed the velocity of x directly but they don’t always give me the same result every single time. The player would land in different places.
var shootDirection : String;
var force : int = 10000;function OnTriggerEnter (col:Collider) { if( col.tag=="Player" ) { if( shootDirection=="left" ) { Global_Cache.playerTransform.rigidbody.AddForce(Vector3(-force, 0, 0)); } else if( shootDirection=="right" ) { Global_Cache.playerTransform.rigidbody.AddForce(Vector3(force, 0, 0)); } } }
-
And also, when the player moves i adjust the x velocity to 5 or -5, but when he slides down i want this velocity to work accordingly to the force of the slide. What happens now is if i hold down the left arrow button the force is ignored and player walks instead of being shot across the slope.