Download

block rotation and linear axis

Hi,

I just would like to know if it’s possible to lock rotation and linear axis with blueprint without use physics constraint

Thanks in advance.

little up :stuck_out_tongue:

Yes you can, by defining the restriction mathematically.

For example you can make an editable 3d widget and restrict it to always move around in a perfect circle by setting its location to x^2 + y ^2 = 1 in the construction script. It still allows it to accept user input but then immediately modifies the values.
.
There are probably tons of ways to restrict something to a rotation axis. I would probably just try setting pitch and roll to 0 and set yaw to yaw (by breaking rotation on current rotation value). That should give you an idea how it works and you can just change which ones get set to 0 and which get set to themselves to get different lock combos etc.

If you want to do it interactively during gameplay (as in not just some construction script trick) it should work as well but you may need to use an intermediate variable to store the rotation without the lock but I am not sure as it could depend on your usage.