Forum rules - please read before posting.

Lock cursor not 'locking' to the center of the screen

The cursor is not locking to the center of the screen, it still 'floats' around as I move it. I believe I have all the correct boxes checked both in the AC Cursor settings (Lock System cursor when locking AC cursor) and in AC Settings (Lock cursor in screen's center when game begins)

Unity version: 2021.3.21f1
AC version: 1.77.0

Comments

  • Welcome to the community, @CamperJohn.

    Are you referring to the "AC" cursor, or your system cursor, or both - and does this occur in builds or only the Editor?

    When you say it "floats", what is the exact behaviour? Is it moving freely, or "jumping" a bit before snapping to the centre?

    If possible, sharing screenshots of your Settings and Cursor Managers, as well as the Game window, will help illustrate the problem.

  • Sorry for the lack of original post information. Hopefully this screen shot will help. The AC center screen is good, but the windows 'arrow cursor' is not locked to it
    https://imgur.com/a/gTzNQjv

  • here is an image of the settings
    https://imgur.com/neB5I7M

  • Thanks for any suggestions

  • Thanks for the details, though I'm not able to recreate it on my end with the same settings.

    Is this occuring in builds as well, and do you have any other assets installed that may also be controlling the cursor?

    As a test, let's see what the result is of cycling the AC cursor's lock state on and off is. If you go to your project's Input settings and define a new input named "ToggleCursor", map it to e.g. "space" and try pressing that key at runtime. Once the AC cursor has unlocked and re-locked, is the system cursor then behaving?

  • Thanks for your reply, I really appreciate it.

    I have a Toggle Cursor already setup from one of your tutorials in order access the Inventory items in the upper Inventory menu. Here is a screen shot of my Project Settings for inputs:
    https://imgur.com/0QVro1g

    At the start of the game, the windows cursor (as shown in the first posted image) is not attached to the AC center spot. If I left click anywhere in the screen, the windows cursor then locks to the AC center spot (as it should) and everything works fine.

    Pressing the Toggle Cursor unlocks the cursor from the center of the screen allowing to select and use Inventory items. Pressing the Toggle Cursor again, locks it back to the center as it should.
    The issue is at the start of runtime when the cursor is not locking to the main AC center spot.

    I do not believe I have any other assets that would be interfering with this. The other loaded assets are mostly Synty and some audio sounds.

    Again, thanks so much for any direction.

  • If I left click anywhere in the screen, the windows cursor then locks to the AC center spot (as it should) and everything works fine

    This suggests it's part of Unity's built-in behaviour, where the Game window needs to be "focused" in order for it to take control over the cursor. I'd expect that this issue would not occur in builds - just more of a nuisance when testing.

    Before running your game, look at the top of your Game window and try setting it to Play Focused, as opposed to Play Unfocused.

  • I went ahead a did a build and the cursor acts as it should. I tried both Play Focused and Play Unfocused and I was experiencing the same issue. It is not a big deal at this point since it works fine in the build. Thanks for all your thoughts and time to look into it. I'm good with closing this since it works fine in the build and just 'acts up' in the editor. Thanks again.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.