How to make a player move up then forward using ontrigger enter collider?
I want my player to move up then forward when they jump inside a cube collider.
There is a cube in front of the character.(He can see it) There is another cube at the top of that cube which has the climbing script attached.(He cant see it)
I dont know how to make the script for my character to move up then forward when they jump and enter the invisible cube. Can someone help me please!?
So you want the invisible cube to sort of add a force that makes your character jump up in a forward direction. check out the link see if this can help you out. If you still have problems i can drop some code on you.
http://docs.unity3d.com/ScriptReference/Rigidbody2D.AddForce.html
If you just want to do exactly that, move up and then forward, you can easily script it with coroutines. I recently provided an answer + detailed example + interactive demo that moves a cube up, rotates it, then moves it down again when you click it that you may get some ideas from.
Start the coroutine when you detect the collision.
If you want to play an animation, you could have a dummy gameobject with an animated child. Position the dummy gameobject at the players position on collision, and then start a coroutine to copy the position from the dummys child to the player.
Your answer
Follow this Question
Related Questions
Unable to join player connection alternative multicast group. 1 Answer
Next Level Using numbers 5 Answers
Errors in my script 0 Answers