- Home /
Move mouse to a position on screen?
I am making a game where you have to move the mouse through a level without touching the edges. But to do this i need the mouse to move to a start position in each different level. How can i do an on start make mouse position the same as where i want it to be when the game starts?
I don't know if there are plug-ins that can do that, but have you considered designing the game so that you don't need a technical solution? For instance, if you make the player press or touch a button to start the level, and you place the button at the start position, then the mouse will be guaranteed to be there when the game starts (that's how all those Flash games used to do it).
Answer by Jazzer008 · Apr 20, 2013 at 02:46 PM
Mouse position input is read only. A complicated solution would be to lock the system mouse and display a 'fake' gui mouse, moving it around using the system mouse inputs. Then you could move this to any position desirable.
But it is quite a complex solution. Personally I agree with @Philipp's simple solution.
Answer by NightmarexGR · Aug 20, 2014 at 06:39 PM
Sorry for necro-posting but i have made a plugin that lets you set the cursor position, exacly what you want ! It can be found here : https://www.assetstore.unity3d.com/en/#!/content/17177
Your answer
![](https://koobas.hobune.stream/wayback/20220613100654im_/https://answers.unity.com/themes/thub/images/avi.jpg)