Quantcast
Channel: Answers for "Get an Object to Automatically Move Forward"
Viewing all articles
Browse latest Browse all 4

Answer by Ghopper21

$
0
0
This line: moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")) means you will move only when there is input, due to **Input.GetAxis("Horizontal")** and **Input.GetAxis("Vertical")** being used for the x and z values of your movement direction. To move forward automatically in a simplistic way, use hard-coded x and z values for the direction you want to move in. If you want to still use input for movement direction but have the character continue to move forward when input has stopped, you can first check if there is input and if not use your existing direction for your movement direction.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images