First Person Character + Controller, can't make it move with WASD
Basically after 3 days of trying, I finally got my character to respond to mouse movement, but it still won't move. Steps I've taken -
1) Tried moving the GameMode, Controller, Character from a FPS template - Did almost nothing
2) Made my own stuff using this - https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/SetUpInput/Blueprints/index.html
3) Changed a lot of settings based on answers I found, such as auto possess character on the FPS Character, which made it respond to the mouse, but not to moving with the keyboard
I'm also generally confused about why there are 5 different things required - Controller, Character, GameState, GameInstance, PlayerState, GameMode.
I'm also disappointed that I couldn't find a clear explanation of what these 5 things do. My current understanding is that the GameMode specifies what spawns, and the Controller possess the Character. But the Character is the one which has the blueprints for input, which is confusing. Because I read that the Controller takes input, not the Character.
Also there's no step by step to simply get a moving character in your game. The link I followed SHOULD have worked, but it didn't. I had to change more settings than stated there to even get it to respond to mouse movement.
Just to add, I'd be more than happy to try using C++ as well. I followed some other tutorial that explained a FPS game from scratch, but every single block of code was followed by "Since 4.6, this no longer works, do this instead + this too" and that additional code gave me errors.
I understand your frustration, UE4 can be daunting at first approach.
Ok so at the very base, imagine you create an empty project.
You need 2 things minimum. A GameMode, so that you can set a different player pawn. A controller to control your player. But as you have noticed, you can control the character from within the player pawn.
So if you start with a level with a light, floor etc., create a new game mode, then a new character as player pawn. So you go, new blueprint, character, and call it "PlayerCharacter" for example.
Assign that character to be the player character within the game mode (it's best to do so in the project settings / maps and modes)
So at the begin play, the game mode is spawned, it will spawn all its sub classes with it. The Character is spawned by default at the Player Start Object.
From there you need input. So you go into Project Settings / Input, Create a new Axis. Call it ForwardAxis for example. Assign the letter W to it and the letter S. Set the W to 1.0 and S to -1.0.
To hook up the axis you can either do it in the controller, or the character itself. For the sake of simplicity, let's do it in the character.
You hook up the axis coming from WS to the control's rotation forward vector and into the scale value. That gives you movement forward and backwards. Then repeat the same process for a new Axis of AD in the input settings.
For hooking up the movement from the controller, you need an additional step. Creating a Player controller for the Game mode to use. And instead of affective the move directly, you use "get controlled pawn" which is the character possessed by the Player Controller.
By setting the Player controller and Pawn and Game mode in the settings, it automatically spawns them and possess the pawn.
Hope this helps :)
From Player Controller (either one or the other):
answered Apr 03 '16 at 11:19 AM
For those of you that make heavy use of shortcuts in your workflow: I had to disable my autohotkey script for input to work.
answered Feb 09 '18 at 08:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here