# How to transform one vector into another?

**URL:** <https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181>\
**Category:** Blueprint\
**Tags:** unreal-engine, transform, vector, question, Blueprint\
**Created:** [March 12, 2021, 3:54pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181 "2021-03-12T15:54:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 12, 2021, 3:54pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/1 "2021-03-12T15:54:55Z")

</div>

I’m trying to transform vector A into vector B, but it jumps at the last moment:

![332236-ezgifcom-optimize.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/b/00ba4d1b5c92fdd9030f3bc27c30a8ae1dcdd90f.gif)

Close up:

![332237-ezgifcom-optimize1.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/8/c28e13f481af56cb83fab4feaeecab4fab94ac95.gif)

Code is wrong, I must assume. What is the correct way of doing this? Thanks 🙂

 ![332238-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/c/a3c1812a24076522b64c10dcd91de0e411712404.jpeg)

PS: They can be different lengths and at any angle, but will have a common point ( as seen here ).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ed880458](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ed880458](https://forums.unrealengine.com/u/anonymous_user_ed880458)\
**Post date:** [March 12, 2021, 4:36pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/2 "2021-03-12T16:36:55Z")

</div>

Hi ClocworkOcean!  
I recreated your issue by your BP. It did the same jump.  
It seemed to me that there is something in VInterp that skipped the last few numbers. I created a workaround and the problem disappeared.

 ![332250-forclockwork.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/9/fd9cbee2ba8aa5c4c8283393170a81efbdf5583a.jpeg)

Let me know if it works for you / you are satisfied with the solution!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ed880458](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ed880458](https://forums.unrealengine.com/u/anonymous_user_ed880458)\
**Post date:** [March 12, 2021, 4:40pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/3 "2021-03-12T16:40:14Z")

</div>

Ignore the double Normalize node LOL 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ed880458](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ed880458](https://forums.unrealengine.com/u/anonymous_user_ed880458)\
**Post date:** [March 12, 2021, 4:49pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/4 "2021-03-12T16:49:02Z")

</div>

This is the point where it jumps:

![332261-forclockwork2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/0/de0b9d79d632f8868f00b8d444234eed3313e10e.jpeg)

The vector length is ~50 for me all around. Which means the VIntep is the only source the jump originates from.  
Hope I helped!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 12, 2021, 5:03pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/5 "2021-03-12T17:03:02Z")

</div>

Printer - I will check this out soon - thanks.

I am aware that the vinterp is incorrect in fact. Interp-ing between two normalized vectors doesn’t give you a normalized vector back, so something’s up there…

---

<div class="post-metadata">

**Author:** ![Grim\_1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/grim_1/32/88715_2.png) [@Grim\_1](https://forums.unrealengine.com/u/Grim_1)\
**Post date:** [March 12, 2021, 6:57pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/6 "2021-03-12T18:57:53Z")

</div>

Take out the normalization of the locations before the VInterp. You don’t need it and I am fairly certain that is what is causing your problem. Look up catastrophic cancellation (yes, that’s the actual scientific term).

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 12, 2021, 7:04pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/7 "2021-03-12T19:04:08Z")

</div>

Right, it works, but WTF!?..

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 12, 2021, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/8 "2021-03-12T19:07:07Z")

</div>

Hi Grim, thanks for your answer, but that doesn’t work I’m afraid.

If you put one vector at right angles to the other, that will make the ball take a straight line between the two, and this is supposed to be a sort of ‘orbit’. It has to go ‘around’ the planet ( that I didn’t actually put in the picture… ).

I’m really looking for some way to rotate one vector into the other, but also to adopt the length of the target vector, progressively.

---

<div class="post-metadata">

**Author:** ![Grim\_1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/grim_1/32/88715_2.png) [@Grim\_1](https://forums.unrealengine.com/u/Grim_1)\
**Post date:** [March 12, 2021, 10:57pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/9 "2021-03-12T22:57:12Z")

</div>

I know what you want, and it will still do that if you take out the normalization BEFORE the VInterp, I never said something about after where you set the length of the vector.

Also, it made me suspicious that @anonymous_user_566a018a 's solution works for you because it should do exactly the same. Turns out that the threshold you have to reach to just jump to the target location is set significantly lower for VInterp than FInterp. I won’t bother you with the code since this is the Blueprint section of AH but it seems like an oversight on epic’s part.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 12, 2021, 11:13pm UTC](https://forums.unrealengine.com/t/how-to-transform-one-vector-into-another/480181/10 "2021-03-12T23:13:55Z")

</div>

You’re right. What’s weird, is that’s what I would have ( and did ) tried first, of course.

I guess without the length computation…

Thanks 🙂
