Dot product Never 1 or -1

To avoid creating extra animations, I am using dot product to decide in which verse the door should open. Alas, despite my attempts, the dot product never gives a -1, as if the forward vector of the door is never pointing in the opposite direction. The result is always between 1 or 0.

Is there anything I am missing?

1 Like

You’re feeding dot an invalid vector. 0,0,0 is not a direction. Get forward derived from what rotator? Did you mean to instead:

2 Likes

I noticed that as soon as I shared the snippets, my bad.
But now I am having the opposite problem: it’s never greater than 0 :confused:
Everytime it prints the string, is always give me a valure under 0.

1 Like

Note that the door may be made out of many components. Actor, as a whole, can point one way, and the swinging component (door wing?) can point some other way. It also depends how things are rotated. Hard to tell without seeing the hierarchy.

Perhaps it’s a matter of sampling the component’s forward / right?

Thank you for sticking with me! ;_;

image

Consider this:

If my door’s functionality revolves (ehm) around rotating the component only but I keep asking the actor its direction, I will not get what I want.


Perhaps you need:

image

Or its right vector, depending on the initial / original orientation of the component or even its mesh.

1 Like

Looks like this was what I was missing. Thank you so much for your patience. Will look more carefully into the theory next time before asking. :clap:

1 Like

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