I'm a beginner at Unity. I have a question about moving an object to its location.

Asked 2 years ago, Updated 2 years ago, 143 views

I want to keep the Circle object going up in the y-axis direction. It worked well in the x-axis direction, but when I changed the character to the y-axis, the circle did not move. What's wrong?

unity visual-studio

2022-09-22 21:24

1 Answers

I don't know UNI.T or C, but I know how to search official documents so I took a quick look.

public Vector2(float x, float y);

Generates a new vector for a given x, y component.

If so, what you want:

tr.position = new Vector2(0, tr.position.y + 0.01f)


2022-09-22 21:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.