Heyo,
like the title states, I want to have an animated sprite that changes its position whenever the player mouses over one of the three buttons in my menu scene.
I’ve read some posts but I’m still quite unsure on how to make it work. I only found options to change the button’s sprite itself.
Firstly make a new script that implements the interface of IPointerEnterHandler as seen here:
http://answers.unity3d.com/answers/1095070/view.html which will be a script for your buttons being hovered over.
Then set the position of your sprite gameobject you have a reference to, to an offset of that object.
For example:
public void OnPointerEnter(PointerEventData eventData)
{
spriteGameObject.GetComponent<RectTransform>().position = new Vector3(transform.position.x + OffsetX, transform.position.y + OffsetY);
}