Axis mapping/Pawn movement not working

Hello,

I’ve been trying to recreate the WASD + mouse controls from the 1st Person Blueprint example with a pawn, but the axis mappings aren’t running. The mouse works fine - I can look around with the pawn, but I cannot move forward, back, left or right. I copied the blueprint directly, and made sure that the axis mappings are set under Project Settings. I tried printing something when it registers the InputAxis MoveForward and InputAxis MoveRight, and it was consistently printing, so I’m not quite sure what the problem would be.

Here is what my blueprint for the pawn looks like:

Edit: I can get movement working with axis mapping when I use a character instead of a pawn, but I still don’t know what would make a pawn not allow axis mapped movement.

1 Like

Hi vaughnva,

I had a similar problem. I fixed it by setting the value of the ‘Auto Receive Input’ in the ‘Defaults’ tab of the blueprint to ‘Player 0’. Alternatively you could use the ‘Set Ignore Move Input’ node in your construction script. I am not sure why the ‘Enable Input’ node is not enough but I was happy to get it working. Maybe this works for you as well.

1 Like

Hi ,

I just tried both of those, separately and together - neither changed anything. I’m wondering if my problem may be because I’m using a static mesh as the component (all I have is a static mesh and two cameras that can be toggled). I appreciate the ideas, and I’ll see if I can use this to help fix the issue. Thanks!

1 Like

Hi vaughnva,

The issue here is that Character has a CharacterMovementComponent that automatically handles the consumption/application of the MovementInput vector, while the base Pawn does not.

The base Pawn is quite simple and doesn’t have movement built in. However you can add your own movement implementation via blueprints in the EventTick if you like, or by adding a movement component in code (you can’t currently add one through the editor). In the case of implementing it via Blueprints, you probably don’t want to use the AddMovementInput() stuff, and would instead just handle the response to input yourself.

Another option is to use “DefaultPawn”, which does have a movement component and can be moved w/ the input functions. That Pawn is restricted to spherical collision however, and uses a simple floating/flying movement model.

I know it’s confusing to see the AddMovementInput nodes on the base Pawn without them doing anything. I’ll look in to trying to make this simpler, perhaps by adding a default movement component that you can then hook in to via Blueprints.

1 Like

Thanks Zak, I’ll see if I can get something working with pawns - in the mean time, I think I’ll use characters for player movement then.

1 Like

Man this is frustrating. I’m having the same issue (4.8) while following a tutorial from Digital tutors. The worst part is I had it working fine on the first run through, but now that I started building off of the First Person template, the controls don’t work at all.

The above is what I’m using to create movement… there are physics thrusters set up around the ship and I activate them (with a force of 20,000) on various key presses however its like the keys aren’t even registering at all. I press a key and nothing activates in the blueprint. No yellow lines, nothing. I also tried 's recommendation of turning on auto-recieve movement but this didn’t work.

1 Like

(I know this is a very old post, but just in case other people find this)

You said you’re using a static mesh… that has a default mobility of “static” so it won’t move. You need to set it to “Movable”. We added a warning (in 4.9 I think) if you try to move something that is static.

1 Like

I suggest trying to eliminate some points of failure. You could try to hook this up to “key w” for instance, or simply on a tick with a preset value, to ensure that the rest of the thruster code etc work. Also check the mobility of the root component of the actor you’re moving is not “static” but “movable”.

After those are confirmed to work, you need to figure out why the axis input isn’t being triggered. Maybe a comparison to the rolling ball template would help (it uses “auto possess player”, not “auto receive input”).

1 Like

Setting everything up to event tick is a brilliant way to test to make sure everything else is working… can’t believe I didn’t think of that :stuck_out_tongue: I actually managed to get it working in a new build. I think my issue was that I was using a skeletal mesh without a physics asset cause when I put it all together again its working now albiet with a static mesh again.

1 Like

2020 Update. This fixed my problem. Thanks!

1 Like