Hi,
i have some question about moving left and right 2d object in unity for android.
i want make my object moving to the left side when i touch my screen and when i touch my screen again, i want my object moving to the right side.
here is the video example
in this video, the object itself moving automatically to the left side and the right side. if i touch my screen, the object move to the left side and moving automatically to the left side until it hit the wall and going to the other way
thank you
Well, you could probably use screenwidth/2 to get the center and then if the touch position.x is less than that, it would go left, and if it’s greater it would go right.
Anyway, i want to ask something (sorry if my question is out of the topic)
How i can make my background repeating if my object “player” is moving?
I’m confused because i cant follow the flappy bird tutorial (because the background from flappy bird thats moving and the object “player” itself isnt moving)
I think they use 2 backgrounds, so when the player gets onto the second background, you shift the first background downward to the place where the first one ends.