How do I restrict the movement of an actor to just one axis or only one rotation?

Hi, I followed Tesla Devs Tutorial on how to pick up objects and wanted to know if you have any idea how I can lock an object on only one axis or rotation. (For example if I want a drawer only to move forward an backwards - for only so far that it doesnt go through the back/ its startlocation or out in the front - or for the axis some lever to pull, so you can pull it down, but not through the wall or away from it) … Hope you get what I mean and you have an idea.

Just realised there is some sort of what I want, so I’d like to change it a bit: How do I customize the move-/rotaterestrictions so I can set some kind of max movement( still going with the drawer example ^^) so I don’t have to build the drawer that it just doesn’t fit through the front by making the end a little bit bigger or something( that would be a workaround I guess, but yeah - not everytime practical ^^)

Hi,

You can set constrains for movable objects under the ‘Physics’ tab in the settings of a component that can simulate physics. You can restrict the axis that an object can move or rotate on under the ‘Constraints’ tab.
Your example with the drawer might be a bit trickier tho, as I am not aware of any settings that can limit how ‘far’ the object can travel from it’s original location, I think this needs to be done in code/Blueprints.

Wouldn’t making a drawer opening/closing animation be a better idea, as it seems to be a very constrained and predictable animation that doesn’t require actual physics simulation? Of course this might be not the case in your game.

ANIMATION! … of course, I guess that’s exactly what I had in my mind, but I’m just learning UE4 and until now had no contact with them. Are there tutorials you can recommend, except the unreal-docs and Tesla Dev/similar channels findable from his page? ^^

I’m sorry, but I’m not aware of any external tutorials of this particular subject matter. However, I think I can point you in the right direction on what to look for. If you don’t want to make the animations in an external program, I think Timelines would be the best option. Here is the official documentation about timelines (sorry:D)

Unreal Docs- Timeline

And it also recently came up as a topic in the forums recently, so you might want to check it out as I posted some screenshots there about how to set up a very simple door animation (just implement it using a drawer, shouldn’t be too different)

Forum post about using Timelines

I hope these will help you a bit!

ok, I will take a look in it, again thank you ^^