Calculate distance with forward vector?

I’m trying to make a SceneComponent (so I can add to any actor blueprint) for grabbing and moving.
This is my current setup.

I want to feed in the distance from the Widget Interaction Right to the object I’m grabbing into the forward vector multiplier (inside the red box) but I’ve not been able to figure it out.
I do not want the object to snap to a preset distance as it does now.

I’ve tried using some vector math to calculate the distance, but have not yet understood how to get the correct “forward vector” distance. Hopefully, there is an easy solution to this?

Any help is highly appreciated. Thank you for your time!

1 Like

Hi There!

I don’t understand what you want to achieve, but maybe this can help:

getforwardvector or getrightvector, etc will return a vector with an orientation but with magnitude 1 (normalized, vector length = 1)

to know the distance between two vectors you must subtract them and then get the vector length

if you want a position that is at X distance of its direction then do:

getForwardVector*distance

that will give you a vector but from 0,0,0…if you want the absolute position then add to the current position

(current position + (forwardVector * Distance))

2 Likes

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