How to make my second character move using the WASD KEYS

Hello guys, I’m trying to make my second character in my game move based on horizontal and vertical input (WASD). I thought copying my main bot would work and change the input but that did not work.


I ended up adding input in project settings (axis mapping) and tried the following above but still no success. Please could you guys help and lead me in the right direction. Thank you

P.S My main character moves based on toggle input (Left mouse button). got that from the beginner video “Your first game in UE5”

If you just need to move a character with the WASD key, I would advice you to use the Enhanced Input.

You’ll have to create an Input Mapping Context and an Inpuct Action (set to axis 2D).
Add your Inpuct action inside your Input mapping context and add the keys for the movement.
For W, you have nothing more to do
For S, you have to add a modifier “Negate”
For A, you have to add two modifier “Negate” & “To world space”
For D, you have to add a modifier “To world space”

Then, in your controller or character blueprint, you add these nodes and you should be good to go :slight_smile:

Hey @1neWrld!

@LesPaul0689 had a good answer, there are a few things I would like to add.

Make sure to actually manually set the animation Blueprint for the bot in the Bot_BP!
You’ll also need to set it to spawn with a player controller instead of default.

Hope this helps! :slight_smile:

Noted! Thank you!!

is it fine if i duplicate my first character’s blueprint and add this code in?

It should be fine. There are just holes you’ll have to plug such as the above noted ones. :slight_smile:

It doesn’t seem to work. The second character does spawn but when I press the WASD keys nothing :smiling_face_with_tear:

Well, I see here that you are spawning it.

But we need to see all of the other things- Did you do everything else that was listed here?

Yes, I did the input mapping etc

As well as this

I don’t think it will work like you are trying to do it. By default pawn and character blueprints don’t execute input actions unless they are being possessed by the player controller. If it was an actor blueprint with input actions then multiple blueprints could fire without being possessed but not with characters or pawns. If there is a setting to change this behavior I don’t see it posted here but it might be possible. You could either make the bots actor blueprints with input enabled or use interfaces to control them.