Getting Rotations to line up properly on physics object.

Hey all,

I’ve been smashing my head into an issue I can’t seem to solve for a few days now hoping someone here might have the answer.
In short, I’m creating a physics based rope swing and I want to line up the player characters Z axis with the current rope bone while keeping free degrees of rotation among the local X and Y axis.

This is where I am at so far:

This closest I’ve gotten to make it work and in blueprint it looks like the picture below:

The problem with this attempt in particular though is that i cant seem to smooth out the local rotation of the actor Y with something like a Vinterp to constant because it also doesn’t behave as expected.

(and I feel the way that ive linked the axis isnt “correct“ even though this gave me the best results)

example:

code:

In a lot of my other approaches I find that either the character spazzes out when adding local rotation (presumably due to something else like the player controller also resetting the rotation), or I’m running into weird flip flops of rotations (presumably due to gimbal lock) or just other oddities.

I’ve also tried adding the rotators using a “combine rotators” node which from my experimention is just about the same as adding local rotation offset in reverse order of operations and I’ve tried some custom C++ euler to quat conversion nodes only to find out the results are mostly the same because unreal engine already uses quats under the hood.

Am I going about this all wrong? Is there a better way to do this all or am I just missing 1 last piece of the puzzle? I’ve only been doing unreal stuff for 3 weeks to I’m quite new.

Thanks in advance.

Hey @MarcoStyle how are you?

The issue is that “Set Actor Rotation” + “Add Actor Local Rotation” are fighting each other every timer tick, and the player controller’s rotation management is likely interfering too.

To solve this, you can try with:


This should calculate the correct rotation and rotate the character smoothly!

Regarding the controller problem, the Controller rotation is probably overwriting your work. In your Character Blueprint or the Character Movement Component, make sure " Use Controller Rotation Yaw/Pitch/Roll" are all unchecked, and “Orient Rotation to Movement” is unchecked while swinging (you already have a SET node for this, but verify it’s firing before the timer starts).

And with this, it should be working as intended!

Please let me know if it helps you as I wasn’t able to test it properly!