Quantcast
Channel: Questions in topic: "mouselock"
Browsing latest articles
Browse All 44 View Live

help please :S? im confusing myself.

hey guys :)i feel ashamed that im confusing myself here :) and im probably over thinking but heres what im trying to do.Lock the cursor to the middle of the screen Hide the cursor when not in a...

View Article



Using Screen.mouseLock

So, yeah, I'm trying to use the Screen.lockCursor script found in the docs but don't know how. I just can't figure out how to implement it in the game itself. Do I put it on an empty GameObject? Do I...

View Article

MouseLock is not working

Hello, Mouselock seems to not be working. It's probably my script, as I am new to unity and have no previous experience. My code: *** function OnMouseDown() { Screen.lockCursor = true; } *** Can...

View Article

Mouse Lock script doesn't work once built, help?

script for mouse lock doesnt work once its built, but works in editor... using UnityEngine; using System.Collections; public class LockCursor : MonoBehaviour { void Start () { // Start out in paused...

View Article

Check if mouse cursor is locked

I'm making a game and I want to release the mouse when the player presses Escape or P. How would I check if the mouse is locked or not?

View Article


How to make a mouselock script

I was wondering how I would go about making a mouselock script in C#, for my FPS. It would be awesome if it could be toggled in a way so that you could still use GUIs.

View Article

Screen.lockCursor mystery?

I'm using this simple code on my custom FPS character controller: void Start() { // Lock Cursor Screen.lockCursor = true; } I just want the mouse cursor to stay frozen where it is (ie: always in the...

View Article

disable script when i press escape??

hey, i have this java script that locks the mouse for my FPS function Update () { Screen.showCursor = false; Screen.lockCursor = true; Screen.lockCursor = false; } if(Input.GetKeyDown("escape") {...

View Article


Disable player input whilst a GuiTexture is enabled?

Hi, I'm trying to make it so that when I hit "e" on an object, a Guitexture appears (a piece of paper), the player can't move again, until he hits "e", in which case the paper is dismissed and movement...

View Article


Disable Player Controller/Camera when GUI is displayed?

When I first initiate my game, only the GUI is displayed and works without any issues. When I spawn my player prefab, this has a Camera/Controller/Motor attached to it and seems to break my GUI (can't...

View Article

Mouse wont relock

Hi, i am working on a building game and i want to have a menu where you can select items. the mouse starts off locked when i press e(the inventory button) it unlocks like its supposed to but when i...

View Article

Where to add mouse lock script?

I created a mouse lock script to lock the mouse cursor in the center of the first person controller camera.. but i dont knw where to attach it. This is the script.. using UnityEngine; using...

View Article

Accessing Variables from other scripts

I'm kind of a programming noob, but my knowledge should be good enough to get this simple game I'm trying to make done. So my question is that I have a pause menu, a GUI appears and I want to be able...

View Article


How can I lock the mouse WITHOUT it going to the center of the screen?

**How do I lock the mouse cursor, without it going to the center of the screen??** **----OLD-----:** How do I show the mouse while it is locked though? I want it locked at its last position, not just...

View Article

How to lock mouse cursor but still move camera

I tried myself but it would only lock at random moments, and when it would, i couldn't change where i looked. I am making a game where this would be very unwanted. Here is my code #pragma strict public...

View Article


camera locks vertical occationally

so i've got a script for locking my camera while the menu is open.... problem is that it "Occationally" and yes... it really is only occationally which is why i'm completely lost here, locks the...

View Article

Unbound The Cursor

How do I unbound the mouse like this example inside the game? (not gui) there is a method I can follow to do as this example? all that I've found in the scripting api is Cursorlockmode to locked or...

View Article


Mouse won't unlock in WebGL build but does in the editor

I'm using this code: (in an Update function) if (Input.GetKeyDown (KeyCode.Escape)) { unlock = true; } if (unlock) { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; Screen.fullScreen =...

View Article

Cant unlock mouse on web export.

Hello I'm using basic FPS rigid body controller. I have mouse lock checked. When I export and play on the web it hides the mouse and hitting the escape key once doesn't unlock it. I have to hold escape...

View Article

How to lock cursor in WebGL

Hello, At this point I am quite desperate so I decided to seek help personally. I have this ([project][1]) and in my newest build, when I looked around it would snap back ( probably after the cursor...

View Article

Stop MouseLook when scene get changed Unity

I have a script with MouseLook, which is only in my game- scenes attached to the camera, but if I press "esc" and change to my Pause- Menu MouseLook is still activated, although the script is nowhere...

View Article


Mouse movement on X axis,Mouse Stability on Y axis

Hi guys I have a game that uses the mouse movement on X axis it should be stable on the Y axis. Currently I'm using this script: //Mouse movement X stability float distance = transform.position.z -...

View Article


Mouse Look Cursor Issue

Hi, I am having an issue with mouse input and cursor locking. I have made a custom first person controller with mouse look all included within a single class. The mouse look works fine – except for the...

View Article

MouseLook conflicting with LookAt

Similar to @Broccoli 's question back in the day, however his solution is not working for me. My objective it to make camera appear slightly offset from a gameObject and look at it. I can accomplish...

View Article

Lock Third Person player rotation

Hey guys, I want that my third person character has a lock so he don't rotates over 360°. I hope someone has a solution. Here's the mouse rotating script: using System.Collections; using...

View Article

Browsing latest articles
Browse All 44 View Live




Latest Images