Meet Bobs. I would like to make them lean towards the sphere, but not in this way:
For example, look at the right Bob. He’s twisting when rotating - in result, he lays on his back when 100% leaned.
… And that’s how he should lean:
For now, they get LookAt rotation -> UpVector -> Rotator, but probably it’s not a good way to go with this.
I want to retain local rotation of the actors while they lean towards a point and the lean rotation to be relative to current actor rotation, something like this:
I’ve tried adding/substracting rotation and some other hacky tries, but none worked.
I can’t figure it out… I guess that my brain just turned into scrambled eggs.
I would be grateful if some more math-oriented hero could provide some hints on how to calculate rotation in this way.
Update: I’ve just discovered that there is a material that does a very similar thing in Content Examples -> PivotPainter level. It uses ‘RotateAboutAxis’ node, so it might be a clue, but there is no Blueprint equivalent of this node:
^ That’s what I want to achieve (but without bending) - no matter what local rotation is, it always leans towards the same point. But i can’t use material for this, because I need other objects to inherit the rotation when attached.