# How can I make the timeline length and keyframe values correct so that the lerp will exactly put the First Camera in the exact location of the Target?

**URL:** <https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080>\
**Category:** Blueprint\
**Tags:** timeline, lerp, unreal-engine, question, Blueprint\
**Created:** [January 16, 2024, 2:01pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080 "2024-01-16T14:01:43Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 2:01pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/1 "2024-01-16T14:01:43Z")

</div>

I have the below blueprint, and I’m sure about the values that Current and Target variables are having, but my problem is that in the timeline, I noticed that the length of the timeline or the values of the keyframes are important, meaning that if I set them wrong, the First Camera will move somewhere else. I thought the whole point of the timeline was changing the speed of Lerp, but I didn’t know it could change the movements too. So I want the First Person to exactly end in the location of the Target, how can I do that?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/c/d7c2512e1e38d65a6c632e1bc50e6932d7c5ff76.png)

Timeline:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/4/7f47c6b6d505e3d6fc8015f28722af9977077175.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 3:26pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/2 "2024-01-16T15:26:10Z")

</div>

> [@dabbbbbbbb5656](#):
>
> So I want the First Person to exactly end in the location of the Target, how can I do that?

That’s how the timeline works already. The issue is elsewhere.

> I’m sure about the values that Current and Target variables are having

- could we still how and when they’re set?
- do note that the camera operates in space relative to whatever it is attached to; are you sure `Target` is transformed correctly?

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 3:38pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/3 "2024-01-16T15:38:25Z")

</div>

Here is how I set them:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/d/22dacb47f5a81e53c0cc9968d0eb1646d7154415.png)

For the Parent Socket of First Camera I have chosen the “FFP” socket. And I use the “RTS Parent Bone Space”, which means I want to get the relative location of the sockets.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 3:43pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/4 "2024-01-16T15:43:20Z")

</div>

The above looks fine. Could you elaborate on:

> [@dabbbbbbbb5656](#):
>
> changing the speed of Lerp

How are you changing the TL speed - because that’s what you mean, right? We’re not supposed to touch the TL track points as that would affect sampling and interpolation results. Are you loading curves dynamically? Because that’s a thing, too.

Get `Timeline` → `Set Play Rate` is the way to go. The higher the number, the faster the timeline plays.

- 0.25 makes the TL goes 4x slower
- 3.0 makes it play 3x faster

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 4:04pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/5 "2024-01-16T16:04:13Z")

</div>

Let me explain it better. The below image that you see is the view of the aim camera that is using the aimSocket as the Parent Socket:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/a/1/5a15b872f7d5a08d642428106b83ee4ff0c4cfa6.jpeg)

This is what I see as a result of my code when I lerp:

So why is the First Camera not ending with the view of the aim camera? Because I made it reach the location of the aimSocket using Lerp, I don’t understand why the views are different. I thought it was about the length of the timeline or something.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 4:05pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/6 "2024-01-16T16:05:41Z")

</div>

Draw a debug point/sphere at the current/target transform locations to visualise where you’re asking it to move.

What’s the component hierarchy of the actor?

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 4:16pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/7 "2024-01-16T16:16:16Z")

</div>

I haven’t done the debug point/shere that you are saying, but this is the Components tab:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/c/dac8e45bcc294448a223f95988adcb22ab8d9982.png)

The parent class is “character” not “actor.”

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 4:21pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/8 "2024-01-16T16:21:22Z")

</div>

> [@dabbbbbbbb5656](#):
>
> The parent class is “character” not “actor.”

A character inherits from actor. Looks fine.

Can we double check the sockets then? Is the aim camera offset on the socket? Perhaps derive the transform from the aim camera rather than the socket.

One way or another, I wouldn’t look for an issue in the TL setup - you seem to have it done correctly. Debug the sockets to see where they really are while the TL plays.

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 5:13pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/9 "2024-01-16T17:13:42Z")

</div>

The debug spheres are looking like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/5/56555387e15829206cb8ed159cc9f5cce957a72a.png)

The locations of both cameras are zero:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/1/8913631041d18d5c934791e511a7f6c36ade13ed.png)

The aimSocket is inside the right hand bone layer:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/e/77eac8c42fea514f3fdafed92bea2e2de2f6a195.png)

The FFP is inside the head bone layer:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/c/d6c81ed3953ed072b90a942881fa116fe9c8dfae.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 5:15pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/10 "2024-01-16T17:15:48Z")

</div>

> [@dabbbbbbbb5656](#):
>
> The debug spheres are looking like this:

They take world space coords, you’re drawing relative.

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 5:49pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/11 "2024-01-16T17:49:25Z")

</div>

This is the world space:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/6/5562f79d8cd87328a99edbdf1a750a66c92deb59.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2024, 5:52pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/12 "2024-01-16T17:52:14Z")

</div>

Seems ok, right? Does it? Hard to judge from my points of view. Do those points move when the timeline pans the camera?

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 16, 2024, 6:10pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/13 "2024-01-16T18:10:33Z")

</div>

Well, changing relative to the world isn’t going to let me observe how they are moving. Because the view goes under ground.  
I moved the character a bit back, and then I noticed the debug spheres never move toward each other; they don’t have any movement.

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 17, 2024, 9:23am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/14 "2024-01-17T09:23:37Z")

</div>

Here is what I was able to do to see how the sockets move. I didn’t touch the Current and Target as they are the positions of the sockets, but I created two spheres and made the FFP the parent socket of the black-red sphere and the aimSocket the parent socket of the white sphere. Then I replaced the First Camera with the black-red Sphere ( which uses the FFP socket just like First Camera)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/8/d385ea0fe40dda853bb4563b57c8724c0f8f4ccd.png)

What could be the reason that the black-red sphere completely does not overlap with the white sphere?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 17, 2024, 9:25am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/15 "2024-01-17T09:25:23Z")

</div>

I see that you’re lerping transforms, how about you lerp location only (at least for now, to get to the bottom of this). Perhaps something is pivoting as the rotation is taking place?

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 17, 2024, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/16 "2024-01-17T09:38:58Z")

</div>

Before using location for lerping, let me show you what it looks like when I set the rotation of the aimSocket to zero. (The rotation of FFP was already zero.)

Now that the rotations of sockets are zero, will it make any difference if I use vectors or locations for lerping?

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 17, 2024, 9:56am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/17 "2024-01-17T09:56:53Z")

</div>

Here is the location lerping:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/a/d2a8ef9a437f9b3acf681007e26e3b110dcb63ea.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/f/3bfe83c91f6dcc2828b895aeb14cf593a485277f.png)

It jumps somewhere else.

---

<div class="post-metadata">

**Author:** ![dabbbbbbbb5656](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dabbbbbbbb5656](https://forums.unrealengine.com/u/dabbbbbbbb5656)\
**Post date:** [January 18, 2024, 11:01am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/18 "2024-01-18T11:01:58Z")

</div>

Finally, I solved my problem. The problem was not about the timeline; it was about me not getting the transform of the sockets relative to the correct thing. I found a node named “Make Relative Transform,” and then I made the transform space of the “aimSocket” to “RTS World” (previously it was set to “RTS Parent Bone Space”) and plugged it to the first input of the “Make Relative Transform,” and I did the same thing to my “FFP” socket and plugged it to the second input of the “Make Relative Transform,” and then I finished setting the “Target” variable, and that was it!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/2/7b20649a714e294417b9e7de40ea04f49846b1f3.png)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 17, 2024, 11:02am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-timeline-length-and-keyframe-values-correct-so-that-the-lerp-will-exactly-put-the-first-camera-in-the-exact-location-of-the-target/1619080/19 "2024-02-17T11:02:00Z")

</div>

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