# Blueprint moving object different distance each time

**URL:** <https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956>\
**Category:** Blueprint\
**Tags:** moving-object, reference-blueprint, unreal-engine, question, Blueprint\
**Created:** [July 24, 2016, 10:11am UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956 "2016-07-24T10:11:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kligan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kligan/32/248910_2.png) [@Kligan](https://forums.unrealengine.com/u/Kligan)\
**Post date:** [July 24, 2016, 10:11am UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/1 "2016-07-24T10:11:52Z")

</div>

I have this blueprint setup - an obstacle blocking doorway that is being moved away once the player has a leaver.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/0/20002faf28adfd94ca98cf6ced46f14334b53684.png) ](https://i.imgur.com/removed.png)

But the thing is… It’s moving different distance every time! Sometimes it moves to where it should be, sometimes it moves less and the player can’t squeeze in the doorway anyway! Why is it doing that? Why it moves differently each time even though the numbers are static and do not change? At least they shouldn’t…

---

<div class="post-metadata">

**Author:** ![Kligan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kligan/32/248910_2.png) [@Kligan](https://forums.unrealengine.com/u/Kligan)\
**Post date:** [July 24, 2016, 10:57am UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/2 "2016-07-24T10:57:12Z")

</div>

Ok, I seem to figure out what’s going on… The distance that blueprint moving the object depends on FPS. I forcefully overloaded the scene to drop my FPS to 40 to test that out. Lockers were barely moving at all. While at 100+ FPS they are moving where they supposed to be.

Does anybody knows how to fix that?

---

<div class="post-metadata">

**Author:** ![Marooney](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marooney](https://forums.unrealengine.com/u/Marooney)\
**Post date:** [July 24, 2016, 11:39am UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/3 "2016-07-24T11:39:30Z")

</div>

Hi there, you just need to multiply your movement distance by **Delta Seconds** to make it framerate independent.  
That is what the DeltaSeconds pin is for at the EventTick Node 🙂

hth 🙂 Marooney

---

<div class="post-metadata">

**Author:** ![Kligan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kligan/32/248910_2.png) [@Kligan](https://forums.unrealengine.com/u/Kligan)\
**Post date:** [July 24, 2016, 12:02pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/4 "2016-07-24T12:02:55Z")

</div>

Thank you for your reply!  
I seem to be doing it incorrectly:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/0/20002faf28adfd94ca98cf6ced46f14334b53684.png) ](https://i.imgur.com/removed.png)

Either way all it does is just makes the lockers disappear.  
Could you please elaborate what exactly i need to multiply here?

Edit.  
I tried everything I could think of, googled info about Delta Seconds… You said to multiply the movement distance. So, it supposed to be like that:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/0/20002faf28adfd94ca98cf6ced46f14334b53684.png) ](https://i.imgur.com/removed.png)

But it’s still doesn’t work. The locker just disappears. I’m clearly misunderstanding what I’m supposed to do.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a2509f6c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a2509f6c](https://forums.unrealengine.com/u/anonymous_user_a2509f6c)\
**Post date:** [July 24, 2016, 3:30pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/5 "2016-07-24T15:30:00Z")

</div>

Hey friend I would try to remove the timeline, something similar to this, here I’m rotating the character until hes facing enemy.

 ![99804-interp23.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/6/f561c825928893887fbd3cb2b998c2d7e2870fb0.jpeg)

---

<div class="post-metadata">

**Author:** ![Kligan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kligan/32/248910_2.png) [@Kligan](https://forums.unrealengine.com/u/Kligan)\
**Post date:** [July 24, 2016, 3:41pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/6 "2016-07-24T15:41:33Z")

</div>

I can see why it would work for rotation. However, I need to make the movement smoothed out at the start and finish to make it look somewhat believable.  
Here’s what I mean: [- YouTube](https://www.youtube.com/watch?v=0fmC8x6VSUw)  
I recorded this video as a sound test for my friend who’s making sounds for my project.

If I remove the timeline, then the locker movement will look really weird and artificial.

---

<div class="post-metadata">

**Author:** ![Marooney](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marooney](https://forums.unrealengine.com/u/Marooney)\
**Post date:** [July 24, 2016, 4:26pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/7 "2016-07-24T16:26:20Z")

</div>

Oh, sorry i did not realize that you use the Timeline for that… I guess i see your problem: You take the **already changed** Location for the next Lerp. But you need to inerpolate between **initial** and **final** location through out the time.  
Just try this:

 ![99812-moveobject.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/5/465d21a3e2f52a7aa9f08464bb87bb151213372e.jpeg)

 ![99813-moveobjecttimeline.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/a/0da217f12ea69843736d9316ddc9b1a6c936b4f5.jpeg)

---

<div class="post-metadata">

**Author:** ![Kligan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kligan/32/248910_2.png) [@Kligan](https://forums.unrealengine.com/u/Kligan)\
**Post date:** [July 24, 2016, 4:54pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/8 "2016-07-24T16:54:28Z")

</div>

Ah! And since in my variant the location is changing during the animation time, it’s being affected by FPS. Am I understanding that correctly? And by setting the constant initial position we’re fixing that.

Thank you very much! That helped. Also, your hint about Delta Seconds was really helpful as well. I’ve read some articles about it and learned alot.

---

<div class="post-metadata">

**Author:** ![Marooney](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marooney](https://forums.unrealengine.com/u/Marooney)\
**Post date:** [July 24, 2016, 6:11pm UTC](https://forums.unrealengine.com/t/blueprint-moving-object-different-distance-each-time/364956/9 "2016-07-24T18:11:03Z")

</div>

You are welcome 🙂

Yep, i have just tested this myself. The Timeline executes every frame. So it is pretty much just a TickEvent.

 ![99823-timelineframeratedependency.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/b/efb20e918f8bfe88654a5e5427fec7c7bf9d1818.jpeg)

```
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.012
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.012
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.197
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.197
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.216
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.216
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.229
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.229
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.243
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.243
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.257
LogBlueprintUserMessages: [ThirdPersonExampleMap_C_2] 0.257
```
