Forum rules - please read before posting.

First Person Cursor Locked.. But operating system mouse cursor not hidden/locked..

edited May 2018 in Technical Q&A
I have an issue where when the player looks around moves.. the standard operating mouse cursor is still appearing and is not hidden/locked within the game's window.. Any ideas? I am working on a first person game in which the cursor is locked center screen.. but can be used for inventory. 

https://gamejolt.com/games/Pilgrim/340280

Comments

  • In which versions of AC and Unity?

    Are you using Hardware or Software cursor rendering?

    If Software, have you checked Lock system cursor when locking AC cursor? in the Cursor Manager?
  • edited May 2018
    I solved it with issue with changing keyboard + gamepad settings.. switched to mouse.. well i think i cant remember if it was other way around now haha.. but the look movement is varying a lot a lot from system to system to os to os.. people adjusting their mouse settings it will effect the menu mouse but not the ingame look sensitivity. Mouse locked to center screen now and its hidden as well now.. but whew.. still issues with the look sensitivity varying from system to system. Using software, because if i use hardware the cursor/crosshair in the center wobbles around otherwise and doesnt stay fixed in center. 

    Is there a default sensitivity that works pretty well across most systems for the first person controls with mouse or gamepad?
  • Hard to advise, because I don't know what the difference in sensitivity is caused by.

    With "Mouse And Keyboard" input, the free-aiming vector is just using Unity's standard Input.GetAxis calls to read the CursorHorizontal and CursorVertical inputs.

    What you can do is override the calculated free-aim vector, by overriding InputGetFreeAimDelegate (see the Manual's "Remapping inputs" chapter), with one that accounts for these differences - whatever they end up being.  Not sure if it's screen resolution, or perhaps reading the change in mouse-position each frame gives a better behaviour.
  • Oh boy.. not exactly sure how to fix as like you say could be screen resolution or maybe changing mouse position each frame.. which i dont know how or really what i should be doing to try to test.. or how to really figure out which it is.. seems like overriding inputgetfreeaimdelegate could be of use I just don't quite get it by just looking at the manual and I am afraid of coding as it seems might need some? haha

     I am thinking of getting UFPS to integrate with adventure creator in hopes that might sorta fix the issue plus help the over all movement/feel of looking around/controlling in first person. But it seems like i should have been using that to start with my game rather than importing after the fact as it says in the manual you should import it first and then adventure creator and that as well may need some custom scripting depending on my game.

    I guess ultimately I need to look into all this more and learn more. Think I am in over my head here as an artist trying to make something. Thanks for your responses Chris as usual!
  • I would definitely do some testing in a fresh project if you're looking to change over to UFPS, but importing it first is just a convenience.

    As UFPS is classified as a "Complete Project" on the Asset Store, it'll overwrite your Inputs, Tags and Layers.  AC, however, will add its own ones automatically if they're removed - so you should just have to add any additional inputs you've defined manually ("InteractionA", "EndCutscene" etc).

    AC comes with a UFPS integration script, but it's desigend to be a "base level" integration given the wide variety of game types you could make with the two assets combined.  It should get you moving about with a UFPS character in AC quickly, but you may need to tweak it to suit the needs of your own game.

    It's isolated from the rest of the code, however, meaning you can copy it and make changes (if necessary) to a fresh script without modifying AC's included scripts.
  • edited May 2018
    I'm sort of afraid to add in a new player controller if i was to spend $75 to get UFPS..  is there any ways of changing the standard first person controls in adventure creator to be less.. as players are constantly complaining... "Too slow" "Seems Drunk" "Weird" etc.. and then giving it a poor rating and making sure to comment how the game is "broken" because of this.. and I still have an issue where the mouse cursor is overlaying the game cursor on some people's computers.. Altho it's doesnt do this on my system! 

    I do get what people are meaning when they say "drunk" or "slow" as i do think its a little weird.. but its really not so bad on my system, but maybe i am the weird one..

    Anyway I can convince you to download and give my game a go and see what you think may fix the player controls/looking around? Haha.. If anyone else has used a different player controller prefab other than the default one for adventure creator and has some tips on how to get it working that may also help!
     
    https://gamejolt.com/games/Pilgrim/340280

     
  • edited May 2018
    I've played the game, and (speaking with my player hat on), I'd say that one of its obvious weaknesses is the controller. That's especially noticeable in the spaceship segment at the start, unfortunately

    I've not tried developing a First Person game using AC yet (only 2d and Third Person 3d games so far), so I can't give any advice on the mechanics of replacing it, but reading through the forums, you can see that it's clearly possible

    I think for this paricular type of game, getting UFPS would be overkill, and you might be better off simply experimenting a bit more with the settings on the existing AC controller. I'm currently using the AC Third Person controller, and even after a month or so of development I'm still tweaking settings looking for the ultimate sweet spot. I also found that changing the cursor from software to hardware rendering made a noticeable improvement to how the game played

    Replacing your controller with the standard (and free) Unity First Person controller would be another option. I've used that in non-AC games before now, and it's a pretty solid controller in its own right (although you would have to go through an integration process to get it working in AC, of course, as you would with UFPS, or any other controller for that matter)


    As a p.s. on a bit of a tangent from the main topic, but one thing I really liked about the game was the ambient music, and particularly the theme in that place where you had to hit the thingees in the right order. That bit of music was very evocative. Oh, and the geometric patterns that were displayed whenever you got an item, those were pretty cool too

    Unfortunately, the game world is full of trolls, people who've never experienced the frustration of actually writing a game themselves, they just sit there and badmouth anything that isn't the latest GTA (and they probably even sit there and badmouth THAT too). Don't let them get you down
  • Thanks much for the response!

    Guess I'll keep trying to tweak the settings of the controller. A lot of it seems to be that its almost as if its on an anchor or pivot or something.. just ultimately i think the first person setup within adventure creator is maybe just a sort of temporary quick thing that was made & not really meant to be all that great... (don't get me wrong it's workable.. but I think I definitely made it worse some how.. haha) 

    I'd love if someone developing a first person game with the standard adventure creator first person player controller could suggest some settings that worked better/well for them. Or if someone could make a tutorial or at least a pretty thorough guide as to how to add in the unity first person controller instead of the adventure creator one!

    Agreed that spending $75 on UFPS probably unneeded expensive just for the player controller.. especially since seems like knowing me I'll prob break the entire game if i was to try to add that in after the fact now as seems I should have loaded a UFPS controller first before starting making the game.. =(.. seems it can be done after, but i am too afraid.. and then well.. starting over from scratch not really an option I want to tackle.. haha.. Ultimately as per usual.. it all just comes down to me wishing I knew how to program or knew someone that would be willing to write me up a new player controller.   

    Thanks for advice as far as software to hardware..I had this weird issue when switching to hardware where the game cursor got resized weird and then also would wobble and move around as you moved the mouse to move/look.. it was locked to center screen but it would move and do weird stuff! So unfortunately switching from software to hardware for the cursor sort of out the window since not sure what's up with that for me! Did come across someone else with that issue, but the thing that fixed it was switching to UFPS player controller.. so.. hmmmphh.. Maybe i need to update unity and adventure creator.. i mean i know i need to, but again hesitant as i am just an art boy who barely managed to get this game put together.. altho i did back up the game.. so maybe I could without too much fear of breaking everything when updating.. 

    Thanks for your kind words about the game. It helps me feel a bit better! Haha.. i erased a couple comments from people that were just asinine! Then checked out the games they had released and couldn't help but feel if they are saying this stuff about my game & giving it a 2.. then i should probably rate their game a 0 if i was to go off judging things by their judgements.. Of course I didn't.. but I sure was tempted! Some of it is people not reading the description/notes.. some of it is people not knowing what a game like Myst even is.. or have never really played an adventure game.. some of it is bugs just honestly causing issues.. & some of it i think is jealousy and some of it is just plain ol' jerks!

    I really want to continue this game, but really need to get past the issues with the player controller/cursor first! It's frustrating!
  • edited June 2018
    Worryingly, I can't free-aim in your Mac demo - free-aiming seems disabled while the cursor is locked.  What are your Unity and AC versions?

    The following settings work OK for me:

    First Person Cam:
    Freelook sensitivity: 13, 13

    Settings Manager:
    Free-aim acceleration: 30

    CursorHorizontal / CursorVertical inputs:
    Gravity: 0
    Dead: 0
    Sensitivity: 0.05


    An integration script the First Person Controller that @HarryOminous mentioned can be found here:
    https://adventure-creator.wikia.com/wiki/Unity_First_Person_Controller_integration
  • edited June 2018
    Hey thanks!

    Yea the mac build is all over weird.. That's a new one! Other people had it crash immediately and/or go to credits (but like a faded unreadable credits) after completing the music puzzle.. or the video animations wouldn't play.. or various other issues.. Or mouse look worked, but was wonky.. but thats the first I've heard of no free-aim on Mac! Maybe since I am using software instead of hardware cursor? I really shouldn't even have Mac and Linux builds on there honestly.. I just did Linux since one of the team members had no other way of seeing what he helped with.. Then I felt compelled to do Mac too.. and well.. with no way for me to test especially for a jam it was a mistake I should prob just delete both. You were only the 2nd person to download that Mac version I had uploaded 0.1.5.. I've deleted it now. haha

    Yeah.. I am using an older version of adventure creator & unity.. so a lot of my problems may very well be because of that very fact. AC 1.59e & Unity 5.6.0f3

    I just uploaded a new build for Windows with freelook at 11,11 and changed free-aim acceleration to 30 just by coincidence. We will see.. haha.. runs from start to finish for me with no standard operating system mouse cursor overlaying the game crosshair/cursor and movement is improved for me, but it never really was an issue for my computer in the first place.. where others said it was slow or mouse cursor showing up or both.. and one person tell me on win10 it was just crashing left and right with no particular rhyme or reason.. this may have happened to more than just that one person.. but of course not everyone takes the time to report these things.. 
  • Certainly the mouse cursor showing up has long been an issue, but so far as I can tell this is to do with Unity.  Perhaps a script to "brute force hide" the cursor at all times is necessary, but this is only an issue with Software cursor rendering.

    It's possible that the mouse speed could well be tied to screen-resolution - though even that Unity First Person Controller doesn't account for it.  It would be possible to tie e.g. the FirstPersonCamera's Sensitivity values to it through a custom script, but I think you'd need to get reliable feedback from users about their resolution etc to see if there's a correlation first.
  • Thanks Chris. Yea i had been wondering about brute forcing it to hide.. I am going to update Unity and adventure creator after making a new backup. Seems like maybe the sensitivity is a bit better after this most recent build.. at least I got a new comment today without the typical complaints.. and actually got a nice comment... so hey who knows! Very weird as it always worked pretty well for me.. I think my mouse speed must partially be way faster than the typical user.. that is to say its definitely not 100% the cause, but it wasn't helping anything. 

    I'll do some experiments with different resolutions between a few couple computers and see if i can find any correlation. 

    It's weird that mac couldnt even freelook and while Linux could freelook it was impossible for linux players to turn all the way around smoothly.. I still need a video capture to understand that one because they said "If you keep the mouse within the game window it doesn't cause a problem" but then when i asked if the mouse cursor was going outside their play window still when they go to look behind them or just all together.. the response I got was "its hard to explain, but no the mouse isnt leaving the play window.. I just can't turn around or look behind me without it causing issues" I then sent a vid of me looking around in circles in-game "so you can't do this?" and the response was "Nope!"
  • If there's trouble when the system cursor leaves the window, you can have it lock along with the "AC cursor" by checking Lock system cursor when locking AC cursor? in the Cursor Manager - is that already enabled?
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.