How do I lock physics on 2 axises for a 2.5d game?

I have a sphere on which physics is enabled. My game is a 2.5d platformer and I want to prevent objects from falling from the stage.

Here is a image of my scene and my sphere one which I applied a constraint (but obviously doesn’t work).

How do I prevent my sphere to role on the X axis?

Hi JPLeclerc,

This isn’t possible to do in the Editor unless you go into the code and edit the physics.

My suggestion would be to use a combination of depth and/or Blocking Volumes. If you look at Shadow Complex for example, most of the background objects that explode and bounce around are either far enough from the player as to not impede his path or blocked by Blocking Volumes.

If your goal is to keep something in the players path (like a box or barrel that the player needs to knock through the level from point A to B) you could sandwich the player path in between 2 Blocking Volumes.

I hope that helps.

Thanks, TJ

Would it be too hacky to set the X value of the ball to the character’s X value on eventTick?

Could you include a screenshot of your Blueprints so we can see your exact setup?

Hi JPLeclerc,

We haven’t heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you still have questions about this, please feel free to post back here.

Thanks, TJ