How do I make a surface move a player forward?
What I want to do is when you land on certain surface that it launches you forward in the direction it was facing. I have no experience in coding with Unity so if someone would help me with this that would be amazing.
Answer by hexagonius · Mar 01, 2016 at 10:40 PM
Looks like you're interested in collision handling. Either the player or the ground you're interested in needs a script with OnCollisionEnter. IF however your player is a CharacterController and not a Rigidbody, only it can have the script but with OnControllerCollider hit. Use either version with it's parameter by which you will be passed a reference to the other. The player should have a method handling the forward throw, depending on being a rigidbody or a CharacterController it should use AddForce or change some value that goes into the Move function of the CharacterController (of course only in that case). So when the player collides with that ground the collision method should trigger and call the function on the player.
So your interests should go here and here
Remember, a collision with a CharacterController is a onesided one, only it will receive info where a collision with a rigidbody, both participants will receive info