- Home /
UI position and Mouse position
Hi all,
I have a Canvas with a child Image Object, the image is a Cursor and I centered it on the Canvas. Then I use a FPS Controller (build-in Unity) with mouse lock enable. The problem is the position of Image different from the position of Mouse. Like the image below. My english is not good, sorry about that.
I still have not found a solution to this problem. Does anyone help me !!
I think the pivot point of cursors is different than the pivot point of images. Try checking if you can modify either the pivot point of your cursor resource, or if playing around with the pivot point of the image component that holds the cursor helps (I would try to put the pivot of the image where the cursor points ;) ).
Answer by Daemonhahn · Nov 09, 2017 at 12:55 PM
That's standard. If you look at the shape of a cursor icon, youll see that the cursor actually starts from the top left. You need to put a better placement of your image,
also you shouldn't be doing a cursor like this. There is a field in the player settings to set a custom cursor.
...unless of course Sinhtulenh wants to change the cursor runtime.
Answer by Mortup · Nov 09, 2017 at 02:16 PM
Select you cursor image on the Project window and go to Import Settings > Sprite Editor. You should see a small window on the bottom-right corner where you can change some of your script's settings. Try changing the pivot value until you found the one you want.
Your answer

Follow this Question
Related Questions
FPS Controller Mouse not locking consistantly 0 Answers
Locking cursor/mouse on an object 1 Answer
Locking the mouse cursor without it centering after unlocking it? 0 Answers
Cursor Disappears In Scene View When Play Mode Is On 2 Answers
Game runs on one screen, cursor wanders onto other screens? 0 Answers