K
K
Kraken1152020-08-27 01:57:13
Unity
Kraken115, 2020-08-27 01:57:13

Movement of sprites, buttons and clicking on them?

Greetings! I'm not very good at Unity. UNITY 2D. However, the question arose of how to implement the following feature:
1) Departure of the sprite from the edge of the screen
2) By clicking on it, check it back over the edge.
3) What would it be random - that is, sprites came out from all sides in different ways.
What I understood:
1) We call the procedure for crawling sprites in FixUpdate, so as not to be tied to the FPS frequency on different hardware
2) Instead of clicking on the sprite itself, like you can use the button - picture. i.e. the canvas object.
3) To check in and out of a sprite, you need to use a coroutine.
What I still don’t understand:
1) how to organize a click on an uneven sprite That is, the shape is not correct
2) How exactly to make the exit and the most interesting thing is that he would move part of the way straight, and then, for example, part of the way to the side
Thank you in advance

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question