Top-Down Shooter Motion

I started to work on a top down shooter where the player moves the mouse to aim in that direction. I wanted to have the player move up, down, left, and right an the when the WASD/ arrow keys are used, but it will only move in it’s own x and y axis, so when you rotate the player half a rotation, D moves it left and A move it right. i can’t figure out how to modify the current script i have (FPSWalkerEnhanced: to do this. Please help.

Sounds like you want the player to face where the mouse cursor is, while the movement is directly relative to world, rather than players rotation… if so, I think just maybe eliminating this line (to keep the world coordinate system) just might do it:

moveDirection = myTransform.TransformDirection(moveDirection) * speed;

It pops up a couple of times, just delete them all, I think

of course, if you want to keep the speed intact you should replace the line above with:

moveDirection = moveDirection * speed;

careless of me…

I have a project that I am working on that is a top down game as well so i know the confusion at first. I would recommend this link to a very good walk through of what a 2d top down shooter really is.

Hope that helps