Quantcast
Channel: Questions in topic: "lockcursor"
Browsing all 92 articles
Browse latest View live

Screen.lockCursor for web player?

I don't think Screen.lockCursor = true; is working when I build for web player..

View Article


screen.lockcursor locks the cursor in wrong place

void Start () { Screen.lockCursor = false; Screen.lockCursor = true; } // Update is called once per frame void Update () { if(Input.GetKeyUp(KeyCode.Tab)) { Screen.lockCursor = !Screen.lockCursor; } }...

View Article


Fake, clamped cursor in WebBuild

I'm making a gesture heavy game (simple but "broad" gestures). As a result I want to clamp the mouse to the game window so that errant gestures don't end up switching you away from the game. It's...

View Article

Need to play lock-on sound only once when crosshair placed onto enemy

Hi, I have a script which adds the enemies within a trigger to an array, finds the closest one to the player and then places the crosshair onto them and fires in their direction. What I would like to...

View Article

How to lock cursor NOT always center on view?

Screen.lockCursor always make the cursor centered without an option. Any way to do this in unity?

View Article


Screen.lockCursor with two screens

Hi I have the following problem. I use Screen.lockcursor. Works perfectly with one screen but with 2 screens if I open the application and before it finished loading i change the mouse to the other...

View Article

Get change in mouse position while locked

Hey. I have locked the cursor so that it cannot go outside the game window, but this also keeps it centered such that when I call Input.mousePosition, it always returns the centre of the screen. Is...

View Article

Alt+Tab pointer problem

Hi! I have a problem when I'm **"Alt+Tab"**, aka minimize, the game. After I minimized my game and then getting back in to it, some parts of the mouse pointer script doesn't work. The crosshair that I...

View Article


DragRigidBodies, Mouse Centering and a custom pause menu. They all hate each...

Hey, I have the DragRigidBodies script on my FPController that also has MouseLook, and I hate how the mouse moves all over the place so you have to dance with it for awhile to pick something up, so I...

View Article


Screen.LockCursor not working in Windows Store apps?

I'm trying to export a game that uses the First Person Controller prefab as a Windows Store app, but Screen.LockCursor doesn't appear to be working. In a custom script of mine I have it calling...

View Article

(C#) Screen.lockCursor not working?

Hello Unity members. This is my first time using Screen.LockCursor so this maybe a noob question. Anyways the proble I am getting it that when the cursor gets unlocked from another script like my...

View Article

How do I lock and then unlock the cursor using the same key?

All I want to do is lock the cursor to the middle of the screen at game start. That part is easy and it works. But no matter what I do, I cannot get a script to properly lock and unlock the cursor...

View Article

Screen.lockCursor not in center of the screen.

I have a project where i use OnMouseEnter() and OnMouseDown() to control what the player is looking at and what is clicked on. For this to work properly i locked the cursor to the center of the screen...

View Article


Can't enable Cursor

In my game I have a script running that basically hides/locks my cursor and puts a custom crosshair on a GUI. #pragma strict var crosshairTex : Texture; // Crosshair texture goes here var position :...

View Article

Lock Cursor problem in Unity 3D 5.

Lock Cursor problem in Unity 3D 5. Hi there I have problem with Lock Cursor in Unity 3D 5 in C# Replace " Screen.lockCursor = true; " on " Cursor.lockState = true; " and shows an error " error CS0029:...

View Article


Why Does This Script Freeze My Entire Unity Editor?

For some ungodly reason, whenever I try to implement this script, when I press play to test the game, it doesn't actually play. The cursor disappears and it hangs on the editor, not allowing me to do...

View Article

Cursor.LockState = CursorLockMode.Locked doasnt works.

i wanted to create a pause menu screen and make it when it is on the cursor lock mode is in none and when the menu is off the cursor is locked, but when i try to lock exiting from the menu it doasnt...

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

CursorLockMode.Locked puts cursor above actual center

I'm using the default FirstPersonController downloaded from Asset Store. My problem is that CursorLockMode.Locked (inside MouseLook.cs) doesn't correctly center the cursor. I need it to be perfectly at...

View Article

"Cursor.lockState = CursorLockMode.Locked" causes Unity to run in slow motion

When I move the mouse, it takes awhile for the affects of my movement to take effect, and it also makes the Unity editor unresponsive since it takes several extra seconds (increasingly longer the...

View Article
Browsing all 92 articles
Browse latest View live


Latest Images