- Home /
How to move a gameobject towards a UI element onscreen.
Hello all, I am making a 2D game in unity 5.0. I have a few coins placed in my game. A UI element (Image) to the right top corner in my canvas with a coin image and a Text UI element to count the number of coins collected by the player(character).
What I want is when the player collects a coin the coin should move towards my UI Image element having the coin image to the right top corner.
Like in crash bandicoot.
here is the video like what i want to achieve. https://www.youtube.com/watch?v=UIzMpI4_c_g
how can i do this?
I tried using Vector2.moveTowards() and gave a target but the movement is a bit off target. Do i need to convert transform to rectTransform or anything else?
Your help will be highly appreciated.
Thanks.
Your answer
Follow this Question
Related Questions
Unity 2D platformer collider 1 Answer
Move Player forward then back after seconds 1 Answer
Poor quality sprite 2D game 3 Answers