Download

Limiting character position to X- and Y-axis only

Hi! I’m relatively new to UE4 and have just started playing around to get a feel for the interface. I created a sidescroller map where movement is limited to the X- and Y-axis, and it works totally fine until I approach a diagonal object, like a rock in this case. The character moves “along” the object and therefore along the Z-axis, which I don’t want it to. Is there any way to not only limit movement, but also the character position?

Added a link to a GIF of my problem.

Thanks in advance! :smiley:

https://gyazo.com/54be9a823fe1d367a48e500e557f5df1

Does your character/pawn have a CharacterMovement component? How are you adding movement to the character?

Yes it does, it’s the default CharacterMovement taken straight from the Sidescroller preset. The “Walkable floor Z” value is set to 0.71 which according to UE is “non-walkable”, is there any way I can fix this in the CharacterMovementComponent header file inside VS?

Just checking, but do you have the planar movement section set up correctly?cebd9cb1296abe814443f9e0235213a613f187f8.png

From the look of your gif, you actually want to restrict movement along the X axis, not the Z (Z is up/down, so jumping, X in your setup is in/out of the screen, where he’s running along the rock). Setting the character to move along a Z/Y plane should stop him sliding along the rock like that hopefully.