D
D
DANICH702020-12-29 12:08:37
Unity
DANICH70, 2020-12-29 12:08:37

What is the code that, when the button is pressed, the GameObject moved to the right (Unity 3D)?

Tell me the code that, when the button is pressed, the GameObject moved to the right? If anything, Unity 3D. The game I have is a cyclist simulator, and on the level there is a road in 3 rows, and in order for him to move from one row to another, he supposedly turned. The GameObject has code for perpetual motion forward. Well, there are obstacles. I will be grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GFX Data, 2020-12-30
@ShockWave2048

var pos = bicycle.transform.position;
pos.x += 1;
bicycle.transform.position = pos;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question