- Home /
How to move an object to a certain direction using arrow keys?
I am creating a Climber game where in the player will jump from tree to tree to evade enemies and get coins. I'm having difficulties in moving / letting the object jump from a certain distance.
Is there any way to do this? I tried using Lerp but it only moves from 2 positions at a fixed position and I have 3 trees. I want to move it at a certain distance from tree to tree.
Answer by frederikedel · May 22 at 01:48 PM
You can usw transform.Translate() to move objects, using a certain distance is achieved by adding your distance to the vector: new Vector3(transform.position.x + distance, transform.position.y, 0);
You could also use Vector3.Right() * distance
Your answer
Follow this Question
Related Questions
Get the distance between the origin and HitPoint for Raycast? 1 Answer
Should i use terrain generation or make it myself for android? 0 Answers
multiplication score with distance, infinite runner 2d 1 Answer
How to increment the number by 1's to get distance traveled? 0 Answers
Temporarily Changing a Variable 3 Answers