Answer the question
In order to leave comments, you need to log in
[Unity] Object movement. What to change?
I am digging with the movement of the main square (player). The internet is full of tutorials, but they are either for 3D projects or the movement is smooth. I need the square to move a certain distance with each keystroke (as in the GIF).
I experimented with "transform" but didn't get anything.
Code:
Teleports an object to a certain point, but does not move it.
Experimented a bit with "transform.translate" but no success.
I would like to know: "What code is responsible for object displacement?" or "What should be written in brackets so that the coordinates are added to the original ones, and not completely changed?" My problem is that I do not read special educational books, but I learn by doing. For this reason I use "player.transform.position = new Vector2 (+4, 0);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question