How Look at Rotation really works?!

Hey devs
I’ve been trying to understand rotations it’s been so long and so far I still have no clue how it works.
I have this very simple code on my BP in VR where I have a sphere collision on the motion controller and I set the actor BP to rotate following the hand movement.
The idea here is to understand how the vector works and so far I’m failing miserably.

The X axis snaps 180 and always face opposite way of the hand position, I don’t understand it. WHY?!
The Y axis doesn’t move vertically and snaps 180 degrees depending on the hand position. WHHYY?!?!
The Z vector NEVER gets under horizon line so follow rotation will only work if following something rotating on Z axis. WWWWHHHHHHHHYYYYYYYY?!?!


1 Like

Can you show the component hierarchy?

Which actor are we talking about here? Are you trying to set the actor to look at itself?

Look at only sets the X to point at the target, no guarantee about anything else…

I used this code

and got this

lookat

Hey thanks for the answer. That’s obvious but I haven’t noticed only X answers properly to the rotation.
The actor in question is the the BP itself, which is a sphere with the thee axis arrows as children. I tried your way, basically switching the inputs on look at rotation and it looks like your one, but the issue for me is that node will do whatever it takes -apparently- to keep only X aligned to the target.
Now that you said, I can’t rely on this node to set other rotation interactions then. I’ll try something else.
Thanks again for replying.

1 Like

I’ve watched it for a little while, and it will always point the X with the Y on the right, and Z upwards. But, sometimes it flips during the change between one location and another.

You can constrain one other axis quite easily, with a direction vector and a ‘make rot from …’ node

image

It might help.

In the end, if you want total control over the rotation, then quaternions is the way. I never use them, so not very familiar, I think that means with using a plugin, or CPP.

1 Like

That’s the approach I’m trying now. Probably using make rotation is better than look at.
I’ll post it whenever I get it working.
Thanks!

1 Like

Have you found any solutions yet? I am still struggling with the same problem using a look at rotation node from “one hand” position targeting “another hand” using a Leap Motion. It always flips trying to keep the Z axis over the horizon line. It is driving me crazy! :smiley:

Yep,
@ClockworkOcean gave the solution. Use the make rotation instead, considering the axis you want to point to the object (in my case the hand), it works like a charm.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.