How can I change the Physics Locked Axis in Blueprints at runtime?

I’m making a platformer and am using the UE4.4 Physics Locked Axis feature to keep my pawn in the XZ plane (by setting the Y axis as locked). I would like to be able to change this when my player hits certain triggers. For instance, I would have my pawn change to ‘Locked Axis: None’ then rotating them and then change to ‘Locked Axis: X’ so that now I would be moving perpendicular to the direction I had been.

Is this possible, and if so how would I go about it? Thank you.

Hi,

This is not currently possible in BP. I think it should be easy to add though and I’ll try and get it in for 4.5

Thank you very much!

Ori Cohen, I know 4.5 is only preview at the moment but I was wondering if you were able to get these feature in? If not that’s fine. I’ll see if I can figure it out myself.

Thank you for the guidance, I will definitely put in the pull request once I get it in.

Sorry no. It should be straight forward to add. Take a look at FBodyInstance::CreateDOFLock

If I’m not mistaken you should be able to just add a blueprint node that lets the user update the axis and then calls this function to ensure the internal constraint is recreated.

Let me know if you have any issues, if you get it working please submit it as a pull request on github and I’ll merge it in.

Ori Cohen, just wanted to let you and anyone else who’s interested that I made a pull request with these changes. It’s pull request #524, under my GitHub username: wolfadex.