2.5D Character Movement Flipping


This might be self explanatory or not but basically, when the player is moving left or right, I want the player’s “facing” direction or LookVector to be going into that direction however, what would be the best way to do this accurately? Would I look for the move direction? (though I’m only doing left and right so?) or would I detect which key is being pressed and “flip” it that way? And what would be the best way to flip the character? Just changing the orientation or what?

What is the best way to flip the character in the way it is moving?

Last question to add onto this, what would be the best way to lock the player on one axis for a 2.5D movement? I’ve heard that in that a while ago, they just used bodyposition to keep it locked though is there a better way? I tried setting the player’s position to X, Y, 0 every time it gets out of 0 though it’s buggy at sometimes and doesn’t set it to 0 exactly due to weird physics issues.

Best way to lock player on one axis or so to accomplish 2.5D movement (or Super Smash Bros/2D Mario game movements)

Yes you can flip the orientation 180 degrees (pi radians for CFrame) and it should change the character that direction. The best way to check which way the player is moving is if the player is constraint bases, check to see if x and z coordinates are positive or negative (not sure if x or z is relative to cam, so check both), and if it is inside a script controlling it via physical CFrame manipulation, then you could use keybindings to change it or just check to see if the x/z value is increasing or decreasing to indicate direction. Cheers.

1 Like