Hello world of Unity. I am attempting to create my very first game which is just a small 3rd Person zombie survival shooter. Literally defend your small house from zombies walking around outside. Very small and basic. Unfortunately the way unity 3D works, the prefab Im using for my character which also has a working gun with animations and firing scripts, it runs off of the basic unity 3D camera controls, and multiple times while working the camera to the upper right corner of the game, I have exited unity completely. If anyone knows how to lock the mouse when we play, any tips or help would be appreciated. I KNOW NOTHING OF SCRIPTING, so if anyone knows anyone willing to teach, that’d be appreciated.
Create a JavaScript script and copy and paste:
function Awake () {
Screen.lockCursor = true;
}
Then attach this script to any GameObject that is loaded when the game starts.