Quantcast
Channel: Questions in topic: "lockcursor"
Browsing latest articles
Browse All 92 View Live

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

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

How can I move the mouse position whilst key is pressed?

I'm using Unity 5.5.2 and even if I create a new Unity project, in the editor, if I hold down a key (any key), then my mouse position locks and I cannot move it. I want my player to move towards my...

View Article

void Update problem

Hello, I created door with keypad script. Everything works fine except if the doors open Im not able to use my pause script. After doors open and i use pause script the player can rotate which doesnt...

View Article


Camera Lock on GUI

I've made a Pause menu for my mini game, but for some reason when i hit escape for the first time, the camera wont stop moving.Its only after i go back into the game and press it again that it works....

View Article

Cursor.LockState = CursorLockMode.Locked doesn‘t 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


How can i lock the mouse cursor in the middle of the screen ?

What i'm doing now is in the Update: void Update () { Cursor.lockState = CursorLockMode.Locked; Cursor.lockState = CursorLockMode.None; } But that make the cursor shaking/stuttering when moving the...

View Article

Cursor not locking in center of screen?

So I wrote a movement script that includes a cursor lock and hide function. The problem is, is that when I unlock the cursor with the Escape key, the cursor can freely move around. That is what I...

View Article


Cant unlock cursor with FPS prefab

I cant figure out how to unlock the cursor fully with the Controller FPS prefab. I basicly need to xecute that code in a if statment (c#).

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

How to lock the cursor without moving to the center? (С#)

HELP PLS!!! (С#) I know how to lock the cursor, but it moves to the center, but I do not need it, I need it from the same place where I clicked.

View Article

Can you lock the cursor to specific coordinates?

Hi! I want to click and hold the left MouseButton and lock the cursor while holding to the exact coordinates where I clicked. Is this somehow possible? thanks in advance.

View Article


Cursor.lockState = CursorLockMode.None; wont work in build

This code is used when I change scenes it works perfect in the editor but in the build, it stays locked how do I fix this?

View Article


Cursor.lockState does not work

simply coded: void Start() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } And there is nomore code changing the Cursor.lockState. It works fine except when I'm using window mode,...

View Article

Cursor.lockState Not working unity 2018.2

In previous versions of Unity the cursor locked to the center of the screen just fine. When I updated Unity it stopped working. The mouse cursor is invisible when in the game window but is not locked...

View Article

Cursor won't stay locked in update!!

Using Unity 2018.2.3ft 64bit Okay so I have this script on an active gameobject. using System.Collections; using System.Collections.Generic; using UnityEngine; public class LockMouse : MonoBehaviour {...

View Article


FPS Controller Mouse not locking consistantly

Hello all, I have been using unity for 6 years and have come accross the strangest thing that appears to be a bug. It started happening as soon as i upgraded to Unity 2018.23f1. The problem I am...

View Article

Cursor.lockState not doing anything

I'm trying to lock the cursor when the player presses the return button. I've set up said button in the editor but when i press it nothing happens. using System.Collections; using...

View Article

Trouble with unlocking cursor

I am having trouble with the cursor unlocking so that the user can click buttons. I have two objects using this same script. When the user presses E on the object, a panel will show with buttons. What...

View Article

Enable/Disable Cursor.visible / CursorLockMode.Locked on Trigger

Can someone please help me with this matter ? I have a first person controller which by default in its script the Cursor is set to Cursor.visible = false; and Cursor.lockState = CurosrLockMode.Locked;...

View Article



Unity 2020+ Project: Cursor Lock Requires Additional Click

I've seen one other variation of this question in regards to this issue from a few years back titled **"Cursor Lock requires an additional click"** that received no assistance. ---------- I am now...

View Article
Browsing latest articles
Browse All 92 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>