Forum rules - please read before posting.

First Person Turning

Hi again Chris. I've tried looking into this with no luck. I am having trouble with the turning of the player in FirstPerson mode (I am using AC for all movement including the FirstPerson cam).

I wish for the player to move slowly when moving the mouse slowly but when moving it faster I wish the player to move/turn faster with it. I believe this is a common function in all games (or at least it feels that way). I wanted to do this because I've found that turning my player 180 degrees feels very lethargic and slow - but before even trying to implement this I have actually noticed that for some reason the system in place is currently the complete opposite to what I want. So when moving the mouse faster the player actually turns a lot slower?

What is the functionality that handles this in AC? I can then try to pinpoint what is going on as I doubt that this is something that should be occurring as it seems very counter intuitive? Thanks in advance Chris :).

Comments

  • Doesn't sound right - the turn speed should match the mouse input.

    Some improvement was made with v1.71, however.

    Lets see screens of your full Settings Manager, "CursorHorizontal" and "CursorVertical" input settings, Player Inspector and First Person Camera Inspector - hopefully I'll be able to see what's wrong.

  • Thanks Chris, realised that I was slightly behind in AC updates (apologies, I usually try this first) so I have updated to v1.71 and will test it again. However I am currently having a problem with the new update, I previously used to change the GameState via script, for example by using the below:

    KickStarter.stateHandler.gameState = GameState.Cutscene;

    However it seems that after updating this functionality has changed as the gameState in statehandler only has a getter and no setter (I believe this is why my code is no longer working. I believe adding the setter back in would work however you've obviously removed it for a reason - is there a different way for me to achieve this now? I've been digging through the AC code and going down many rabbit holes but can't seem to find how to change the GameState now. Thanks in advance.

  • I have found a post where you said that changing the gameState manually is dangerous and should always be avoided - guessing that is why the changes above were made which makes perfect sense. So I'd imagine the better question is:

    Is there a safer way to prevent my player from moving and interacting instead of me forcing the GameState to GameState.Cutscene via script?

    Thank you.

  • I've commented out the problem code for the short term to just check if 1.71 fixes my movement issues and still the same, so here is a link to screenshots of the info your requested above (Settings Manager, Player Inspector, FirstPersonCam, Input Settings).

    https://imgur.com/a/2cZUEZR

    Thanks again.

  • Is there a safer way to prevent my player from moving and interacting instead of me forcing the GameState to GameState.Cutscene via script?

    See the Manual's "Interaction scripting" chapter. You can enforce cutscene mode with:

    AC.KickStarter.stateHandler.EnforceCutsceneMode = true;
    

    It's also possible to use the Engine: Manage systems Action to temporarily disable the Movement and Interaction systems.

    Regarding the free-aiming: are you using the joystick or the mouse at this time? If the mouse, make sure you have no joystick plugged in so as not to interfere with mouse movement.

  • Thank you for the tip regarding EnforceCutsceneMode, seems exactly what I'm looking for.

    As for the free-aiming issues still no luck. I did have a controller connected however I disconnected and restarted Unity to ensure it recognised that it was disconnected but still had the same issue. I also tried a blank Unity project using the Standard Assets FPS controller and had no issue with that so definitely something wrong in my project - I imagine I've changed something somehow somewhere as if it was AC then no doubt you'd have had this issue reported before? I'll keep playing around to see if I can find anything.

  • There's a "First person player prefab" package over on the Downloads page - give that a try in a fresh project. Does that behave more like it?

  • I tried the prefab you mentioned in the fresh project (the one that I tested the Standard Assets FPS controller in) and it seems to have the same issue that I am experiencing in my main project whilst the standard assets FPS controller is fine. So for some reason the faster you move the less of an angle the character rotates.

    So perhaps it is an AC issue? I tested the StandardAssets FPS controller in the fresh project with AC installed (I added a Player script to the controller and set the movement to manual so that AC recognises that it is the player but to ensure that movement is handled by the StandardAssets scripts) and that worked fine with regards to mouse movement.

    I'd imagine that the majority of games using AC aren't FirstPerson however even so I'd have imagined this to have been flagged up. Do you experience the same or not?

  • No, I don't. Did you follow the package's instructions regarding the recommended settings / input values? By fresh project I meant totally fresh - though it's unlikely Standard Assets is interfering, it's important to try to isolate it totally while we find the source of the problem.

  • Sorry, I didn't follow the instructions first time around. I started a complete fresh new project, importing AC and then the download prefab and followed the instructions but still experiencing the same issue. I also tried a new project using the 3D template instead of HDRP just in case (as I again doubt many people use HDRP with AC) but still the same issue.

    Whilst testing I also retried a new project using just the standard assets and again it seemed to work as expected. So I'm really confused as it only happens with AC yet you can't replicate the issue. I'm still fully expecting that the issue is something at my end however I've no idea what.

  • I think it'll be best to make sure we're on the same page on exactly what the issue is.

    The amount that the camera turns should be related to how far you move the mouse - the "speed" of the mouse movement shouldn't really factor into things, and certainly shouldn't cause an inverted behaviour.

    Are you able to provide a video, with the system cursor visible, to clearly show the issue?

  • Yes Chris, exactly how you describe. I'll look into capturing some video and will send you a link once done mate. Thanks again for your help with this (especially replying on a Sunday) :)

  • Here is a YouTube link to an unlisted video showing the issue Chris with the System cursor visible to clearly see the difference between mouse movement and the amount the character turns depending on speed.

  • edited May 2020

    And your "Input method" is still set to "Mouse And Keyboard"?

    What is the effect of setting your "Free-aim acceleration" to zero?

    This looks like a proper project - not the empty one we talked about earlier. If you still have that to hand, zip it up and PM it to me - I'll see if I can recreate it.

  • Yes my input method is still set to Mouse and Keyboard in the Settings Manager, if I set the Free-aim acceleration to zero then nothing changes and the exact same behaviour is experienced (and seems to move the same speed too - I've even fiddled with the value and nothing seems to change regardless of what the value is set to). Presume this is where things are going wrong then as changing this value should have an effect with perceived speed?

    As for the project it was indeed a proper project because I since deleted the test project. I've remade a test project though using the HDRP template. All I have done with it is import AC, setup a new game using the AC game wizard specifying 3D/First Person, downloading/importing the FirstPerson Prefab in downloads page, setting up Axes and other settings as per Readme in FirstPerson Prefab download.

    The zipped folder is around 370MB, I will PM you a link to it on my GoogleDrive. Any issues let me know.

    And once again Chris just a huge thanks for your help with all of this.

  • I think the issue here is that I gave wrong values - I'm not sure how I managed to copy/paste them wrong, but apparently I did.

    The slow vs fast is, I suspect, due to too low a "Max turn speed" value - so the camera won't turn fast even if the mouse moves fast.

    Try the followin instead:

    Max turn speed: 50

    Then for your CursorHorizontal / CursorVertical axes:

    Gravity: 1
    Dead: 0
    Sensitivity: 0.1
    Snap: Unchecked

  • Hi Chris, thanks for the investigation into this. By "Max turn speed" are you referring to Max Free Aim speed in the Settings Manager? As the only setting I could find similar to Max Turn Speed was the "Turn speed" in the Player inspector however changing that to 50 made no difference.

    Changing the "Max free-aim speed" in the Settings did seem to help though so I wanted to confirm if this is the correct setting to change? I'm still not sure though because at 50 I did notice that whilst moving the mouse faster the character was rotating further than before however it was still rotating less than moving the same distance with the mouse slowly (it was just less noticeable). I therefore tried increasing the value to a huge value of 500 however I then reduced the "Freelook sensitivity" in the FPS cam inspector from 3 to 0.1 on the x and y to help me test because the character would be rotating fully around a few times when moving the mouse fast with normal sensitivity values. So in my test with the "Max free-aim speed" at 500, "Freelook sensitivity" at 0.1 and all other settings you mentioned above the problem is still present only it is very minor. The faster mouse movement still rotates the character ever so slightly less than slower mouse movements.

    I must say that at these settings controlling the character is a huge improvement from the initial issue that I had so I am happy with using these settings going forward (changing the value from 500 to 1000 reduces the difference even more so I'll use this setting in my project).

    However I am still curious as to why the issue is still present and also whether I am changing the correct setting or if there is a "Max turn speed" somewhere? Apologies if it is an obvious thing I've missed. Finally I'm still confused as to why changing the "Max free-aim speed" is working because according to the SettingsManager script the "Max free-aim speed" is the dragWalkThreshold variable which is described as:

    /** The minimum drag magnitude needed to move the player, if movementMethod = AC_MovementMethod.Drag */

    However movement mode for me is not Drag but FirstPerson so this variable shouldn't be affecting anything in FirstPerson mode?

    Sorry for the long reply and thanks again for your help with this matter.

  • Yes, I mean the "Max free-aim speed".

    This was originally just used by Drag movement, but it's now used for First Person as well - I'll update it's comment to reflect so.

    As for any lingering issues, I think it's really just a case of tweaking such values further until they feel right for you.

  • Thought so however I just wanted to double check. Thanks again for your massive help with this, as ever your continuous support is amazing!

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.