Forum rules - please read before posting.

First Person -- mouse moves view, WSAD for motion

Hello, all. I am going to do something rather basic I think. I'm using tank controls as of now. I want to have a First Person character but when I move the mouse, that should move the view of the character, as if he is moving his head around to look at things. I want to be able to move forward and back with the WSAD keys of course, but, for example, if I hit 'play' out of the box on a First Person character, and I swirl my mouse around, nothing will happen right now. If I want to look off to the right, I essentially turn to the right with the WSAD keys. Any easy fixes on the described behavior I  want? If not easy, which script and line modifies this behavior? I MIGHT use UFPS for this game, but I prefer to code it by hand myself and use only AC, and some environmental plug-ins. Thanks.

Comments

  • edited June 2018
    Ok, I figured out what went wrong. I did not have CursorHorizontal and CursorVertical in my InputManager. I guess I just assumed those were there automatically. I had to tone down the sensitivity to 0.0085 for anyone who is wondering. My NEW problem is, when going in reverse, if I try to look to the right(mouse look), but step to the left, I get screen shaking and I can't really look the opposite direction. I would prefer the view to be locked to a certain angle, but instead there is a camera tremble. I'll try to fix it later as I'm not describing it very well. Basically, if you are going backwards and holding the A key at the same time, then you try to look to the right, it should feel like your head is going with your body and you are sort of turning backwards naturally. 
  • If I'm following correctly, you're not stepping to the left, but turning left - at the same time as trying to turn right with the mouse.  That's causing a conflict, hence the screen shaking.

    Are you wanting to be able to turn with both A/D and the mouse?  What do you want to occur when both are used at the same time?  It may be that the keys have to be disabled while the mouse is moving.
  • edited June 2018
    A and D should just be almost like a strafe, more like just moving directly to the side without any drift. It's a purely horizontal movement instead of a turn that I'm trying for. W and S operate as normal.  Reference for this controller is Skyrim, first person view. Holding A and D + using the mouse to look should be the way to turn in my control. I'm working on it now.

    Hmmm, edit. I went to change the script and saw this behavior is under tankControl turning, so I switched to Relative to Camera. Now it seems to be what I was after, though there is still a little drift. I think I can fix that in the public acceleration variable of Player.cs, within the inspector.
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.