Disabling Axial Player Movement

Hello!

I’m currently working on an upcoming project that is similar to the mortal kombat franchise. I’ve been able to accomplish most task except I need to disable players movement on their x axis, as they’d run out of the play area or hit an invis wall, as well as messing with the angle the player stands.

I’ve looked everywhere for solutions but most only relate to disabling all player movement, which isn’t helpful to me.

Does anyone know of a way of preventing players from moving on their x axis?

2 Likes

You could use a BodyPosition with math.huge force in the X axis to prevent the movement in this axis. Aswell as disabling Humanoid.AutoRotate, or making your own rotating system using a BodyGyro, so that they can aswell look backwards.

(disabling Humanoid.AutoRotate disables the player’s capability to change their character’s angle w/ keys)

4 Likes

Hopefully this video will be useful for you:

2 Likes

Yeah, I’ve disabled auto rotation already and that went nicely, the issue was arising from the player moving in a direction that wasn’t helpful.

1 Like