WASD control with a top down game

Hello :slight_smile:

I’ve made a WASD movement BP for a top down game :

My camera can me moved 360° around the player, so i need to get world location, then the player will move same direction where the camera is looking for.
However my problem is that if i turn the camera too high, and look to the ground, the player will move slowly…because he will try to go into the ground… ^^’

I don’t know how to fix this, any idea please ? :slight_smile:

Thank you a lot

Get the world rotation of the camera, then split it right there, no need to have that extra node ( I don’t think ).

Also might help to remove Z from the right vector stuff…

Create axis event in project settings.
Then you add A,D as +1 and -1 for X, and W,S as +1 and -1 on Y
Then when you have axis input working, use it in movment part of blueprint.

Forward camera vector (or player character vector) * Y axis
and Right camera vector times X axis.

And you have delta vector for movement.

You also can normalize it then multiply by speed, so it does not move faster diagonally.

Hello and thank you for this 2 answer !

@ClockworkOcean Thank you a lot, but it doesn’t work for me… :s

@Nawrot Thank you also ! It’s seems nice, but i’m not sure how to make what you describe : How can i multiple the vector * Y axis ?

Thank you again :slight_smile: