2D menu background move with mouse

Hello,
I was trying to get that the background of my main menu follows the mouse a little bit, like here:

But I could not find anything about this or what this is called, is this is possible?
Can you help me with the code, are there any documentations or tuturials about this?

Thank you for reading the post, I hope you can help me!

Get the mouse position, convert it to world coordinates, and adjust the position of your background accordingly.

Hello EKPGames!
I get your JS script to work on UI :wink:


using UnityEngine;
using UnityEngine.UI;

public class MouseMove : MonoBehaviour {

void Update () {
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;

GetComponent().position = new Vector2(
(x / Screen.width) * 10,
(y / Screen.height) * 10
);
}

}


You put this script on Image, and then turn on the game. Then you have to play with the pivot of the image, that everything fits right in the center.