How do I limit players to axis movement

I think this would be in the Blueprint section…
Big newbie here, just started working with UE4 last week. Loving the idea of blueprints as my coding experience was from college way back when and I don’t remember much.

I just want to do something really simple.

I want the player to be able to move their object/player (in this case a mesh sphere I created) across an axis line to the other side and back. The object sphere will stop when it reaches the end of the line. They are only allowed to move the object along lines, so I assumed you will have to somehow attach or link the object with an axis. Is this possible?

9324-ball.png

So far I’ve used the tutorial to create a player sphere and move it only left and right on top of a ground material. In my game I don’t want the ground material or gravity, I just want the player to be limited to moving along a route or predetermined axis.

Checkout movment components, you should be able o remove gravity from object using them as well as control velocity on one axis, you can also set two other axis to 0 on Tick event to make sure object stays in one axis.

If movment component features won’t satisfy you, you can always apply your own movment code by updating postion data on every frame using Tick event, you can do that in blueprint but it’s more efficient to do that in C++.