How would I stop player from being pushed in a 2.5d environment?


To go more in depth with what I am trying to accomplish, I want to lock the character to the X axis of the game, so when anything tries to push the player to the side of the 2.5d environment, the player just stays in a locked X axis position.

For example, lets say we had a canon ball that shoots at us, and the CanCollide on the canon ball is true. Lets say that this canon ball has a lot of force applied to it. It has a huge amount of force applied to it, right? If it has a huge amount of force applied to it, and it hits the player, then the player would move in another direction when they are hit. I don’t want this to happen when in a 2.5d environment.

I have tried making my own movement system, which hasn’t been successful, I also tried taking a look at this video here; but for some reason it didn’t really help at all.

Pretty much just trying to incorporate 2d physics into a 3d dimension. You know how when those characters in 2d games walk into each other, and when they collide with each other, they don’t get pushed out of its actual axis, and stays in that exact X axis. That is what I am trying to do.

Any suggestions on how I can achieve this? Thank you.

What you can do is artificially approach it. Have a runservice loop that constantly checks if the projectile is close to a player. If it is, damage them or whatever and destroy the part. Add the part and player to a collision group where they can’t collide with each other in case the run service loop doesn’t respond immediately. The player won’t notice the difference.

That isn’t really what I am trying to say. What I am trying to say is that when a player is in a 2.5d environment, they can be pushable on both sides of the Z axis. We don’t want that to happen.

I want to lock the character on the X axis, so if anything collides with the player, it doesn’t cause the player to be pushed around out of the X axis.

That was just an example of what I was saying, I am not literally trying to create a canon ball, haha.

Just recreated a movement system of mine, and now it locks the player on the X axis so it doesn’t move when force is applied to it. Thank you.

(Just found my solution…)