# Problem with constantly updating actor location and having it move smoothly

**URL:** <https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [December 8, 2016, 1:38pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139 "2016-12-08T13:38:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![LJoonas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LJoonas](https://forums.unrealengine.com/u/LJoonas)\
**Post date:** [December 8, 2016, 1:38pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/1 "2016-12-08T13:38:17Z")

</div>

Hello

I have a problem with making an actor move smoothly. I seem to have tried every possible solution, but nothing solves the problem for me.

What I want to achieve:

1. Player picks up an object
2. Object starts updating its position to always be at the position where the owning player is looking at (and moving at)
3. The updating of the position happens smoothly

What is not working:  
The updating of the positions does not happen smoothly, there is snapping as the object position is updated from A to B

What I currently have:

1. Timeline replacing Event tick - constantly looping
2. Timeline for lerping from the old position to the new position - I realize I am not using the timeline correctly by using the “Set New Time” with the 0.2 value, but this is the best solution I have actually gotten to work. Problem with this is that the speed is too slow and if the character runs fast the object does not catch up. If I up the value to 0.3 or higher it starts becoming not smooth again.

I believe the outer TickTimer is constantly overriding the MoveTimeline, I have tried having some branches there to check if the MoveTimeline is finished before calling it again, but this just means there is a weird gap where the object stops moving for a moment after the MoveTimeline finishes and is started again with the new locations.

If anyone could point me to the correct direction here that would be great.

 ![2016-12-08_15h29_22.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/6/c605a1cb9f50ce3abbb677265e5f1c64c52b1cc7.png)

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [December 8, 2016, 3:05pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/2 "2016-12-08T15:05:08Z")

</div>

Did you tried magic of interpto? [The Subtle Magic of InterpTo() - Unreal Engine](https://www.unrealengine.com/blog/the-subtle-magic-of-interpto)

You could constantly vector interpto to some target, then just change target to new one.

Ps.  
I just had idea (but that is kind of hack, and i am not sure if it will work at all).  
You (probably) could use camera arm, ie put your object on end of camera arm. then menipulate arm rotation and distance (a bit of vector math).  
Then enable lagg for camera arm. And it will nicely interpolate between locations.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2a99da8f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2a99da8f](https://forums.unrealengine.com/u/anonymous_user_2a99da8f)\
**Post date:** [December 8, 2016, 5:30pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/3 "2016-12-08T17:30:36Z")

</div>

> [@LJoonas;634929](#):
>
> Hello
> 
> I have a problem with making an actor move smoothly. I seem to have tried every possible solution, but nothing solves the problem for me.
> 
> What I want to achieve:
> 
> 1. Player picks up an object
> 2. Object starts updating its position to always be at the position where the owning player is looking at (and moving at)
> 3. The updating of the position happens smoothly
> 
> What is not working:  
> The updating of the positions does not happen smoothly, there is snapping as the object position is updated from A to B
> 
> What I currently have:
> 
> 1. Timeline replacing Event tick - constantly looping
> 2. Timeline for lerping from the old position to the new position - I realize I am not using the timeline correctly by using the “Set New Time” with the 0.2 value, but this is the best solution I have actually gotten to work. Problem with this is that the speed is too slow and if the character runs fast the object does not catch up. If I up the value to 0.3 or higher it starts becoming not smooth again.
> 
> I believe the outer TickTimer is constantly overriding the MoveTimeline, I have tried having some branches there to check if the MoveTimeline is finished before calling it again, but this just means there is a weird gap where the object stops moving for a moment after the MoveTimeline finishes and is started again with the new locations.
> 
> If anyone could point me to the correct direction here that would be great.

I worked exactly on something like you and solved it 🙂 and it was suprisingly easy…  
I just got location of actor and following actor, used node get unit direction vector and this value i added to movement of actor who following. Movement is “smoothly replicated” by engine default so im using this kind of smooth movement/following

edit: i done it this way because i have multiplayer game… in single player imo interpolation can work… for good results you must modify some numbers in movement component, i dont remember which ones

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/3/4531d8f8a189a4ea73638dbd2a74f44811bda2f2.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a6244017](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a6244017](https://forums.unrealengine.com/u/anonymous_user_a6244017)\
**Post date:** [December 8, 2016, 6:39pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/4 "2016-12-08T18:39:30Z")

</div>

Thank you and Name368

First of all I tried the VInterpTo, but it is still not smooth. It seems like the tick is interrupting the interpolation and reseting the position constantly.

The spring arm suggestion is very nice. I hacked something together really quickly and the object does indeed move totally smoothly when it is attached to the spring arm and I do not even have to do the updates manually in the tick event.

Name368 - I also have a multiplayer game. If my object that I want to move is basically a simple static mesh actor without a movement component, I can’t really add the movement input right? Should I work around that somehow?

---

<div class="post-metadata">

**Author:** ![LJoonas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LJoonas](https://forums.unrealengine.com/u/LJoonas)\
**Post date:** [December 9, 2016, 11:44am UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/5 "2016-12-09T11:44:01Z")

</div>

> [@devbreak;635109](#):
>
> Thank you and Name368
> 
> First of all I tried the VInterpTo, but it is still not smooth. It seems like the tick is interrupting the interpolation and reseting the position constantly.
> 
> The spring arm suggestion is very nice. I hacked something together really quickly and the object does indeed move totally smoothly when it is attached to the spring arm and I do not even have to do the updates manually in the tick event.
> 
> Name368 - I also have a multiplayer game. If my object that I want to move is basically a simple static mesh actor without a movement component, I can’t really add the movement input right? Should I work around that somehow?

That was me with my other account…

Of course there are still problems with every solution. How is this so complicated. When I attach the object to the springarm it moves nice and smooth, but there is no collision on attached actors as I have found out as they do not perform a sweep, so the object that is carried can just be clipped through objects and the player can just release the object inside a wall or something like that. Working around it seems way more complicated than it should be.

So I am not sure which solution I should be trying to get working here. Seems like I have to keep working on just manually updating the location of the actor that is carried, but VInterp is not smooth for me. Still seems like the Tick event is interrupting the Vinterp by constantly updating the old location (which is slightly different on every frame) causing the object to jitter.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [December 9, 2016, 1:21pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/6 "2016-12-09T13:21:01Z")

</div>

You can turn on camera collision for arm. Not sure if that will work for other objects than camera. Camera collision i think is one of arm settings.

---

<div class="post-metadata">

**Author:** ![LJoonas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LJoonas](https://forums.unrealengine.com/u/LJoonas)\
**Post date:** [December 9, 2016, 2:35pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/7 "2016-12-09T14:35:02Z")

</div>

> [@;635493](#):
>
> You can turn on camera collision for arm. Not sure if that will work for other objects than camera. Camera collision i think is one of arm settings.

I think I have it correctly set up. In the demos for spring arm, the camera does in the end just clip through walls if there is nowhere for it to fit.

image of collision settings on spring arm:

> **[Gyazo](https://gyazo.com/e15045a5b00eee0e95de0ff8ecac7d89)**
>
> Gyazo is the easiest way to record screenshots & videos you can share instantly. Save time with async visual communication that's effortless and engaging.

Also, I am not simulating physics on the object that I pick up, because physics objects don’t replicate very smoothly over the network and I don’t need physics to be enabled when objects are carried.  
If I enable physics on the objects they do collide with the world slightly (when attached to the spring arm), but it is very easy to make them unstable and put them inside other actors (this is not a problem with the solution that constantly updates the locations as I have on my original post)

EDIT:  
This seems like the problem I have with attaching the object to my character:

> **[Adding an Additional World Collision Component to Character](https://forums.unrealengine.com/questions/310319/adding-an-additional-world-collision-component-to.html)**
>
> I’m testing some things using the basic 3rd person character. I want to add another capsule component to the character that will collide with the world and stop player movement. However the second capsule component doesn’t appear to collide with...

---

<div class="post-metadata">

**Author:** ![LJoonas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LJoonas](https://forums.unrealengine.com/u/LJoonas)\
**Post date:** [December 12, 2016, 12:07pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/8 "2016-12-12T12:07:03Z")

</div>

**Bumping**. Anyone? At this point I would be happy if someone told me what the correct way to approach this problem would be. I bet this has been done a thousand times in UE games, I wonder how? Updating the location in event tick seems like the closest I have gotten to what I need (collision enabled on carried object), but it is not smooth…

---

<div class="post-metadata">

**Author:** ![Braix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Braix](https://forums.unrealengine.com/u/Braix)\
**Post date:** [December 12, 2016, 9:32pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/9 "2016-12-12T21:32:49Z")

</div>

I would suggest checking out this tutorial. Should do everything you are looking for and it worked perfectly for me.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![6ixpool](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@6ixpool](https://forums.unrealengine.com/u/6ixpool)\
**Post date:** [December 13, 2016, 2:19am UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/10 "2016-12-13T02:19:38Z")

</div>

Have you tried simply attatching the object to the character actor? There’s an attach actor to actor node (or something similarly named)

---

<div class="post-metadata">

**Author:** ![LJoonas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LJoonas](https://forums.unrealengine.com/u/LJoonas)\
**Post date:** [December 13, 2016, 8:42am UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/11 "2016-12-13T08:42:53Z")

</div>

> [@Braix;637118](#):
>
> I would suggest checking out this tutorial. Should do everything you are looking for and it worked perfectly for me.
> 
> [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Pick_Up_Physics_Object_Tutorial)

Did that work for you in a multiplayer context? As I have understood replicating moving physics objects won’t happen smoothly. I Will try it out again though. Thanks

> [@6ixpool;637231](#):
>
> Have you tried simply attatching the object to the character actor? There’s an attach actor to actor node (or something similarly named)

Yes, as I mentioned above, if I attach the object to the character the movement is smooth, but there is no collision on the object allowing the character to place it inside walls and such.

---

<div class="post-metadata">

**Author:** ![6ixpool](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@6ixpool](https://forums.unrealengine.com/u/6ixpool)\
**Post date:** [December 13, 2016, 5:17pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/12 "2016-12-13T17:17:22Z")

</div>

Odd. Thisll sound stupid but have you tried adding a colision sphere (at least while the object is attached?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_595f74f21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_595f74f21](https://forums.unrealengine.com/u/anonymous_user_595f74f21)\
**Post date:** [December 14, 2016, 3:12pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/13 "2016-12-14T15:12:58Z")

</div>

What is the object in question? Is it a mount, is it some kind of weapon? So you missing the Component Collision Sphere?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f54268a3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f54268a3](https://forums.unrealengine.com/u/anonymous_user_f54268a3)\
**Post date:** [December 14, 2016, 5:30pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/14 "2016-12-14T17:30:54Z")

</div>

You can have collision on a camera on a swing arm, so it won’t clip, for sure.

If you don’t want it called every tick, call the update function on a timer loop. With Interp, you do want to restart it with the current position each time. If it’s jerky, there is someone wrong with the starting position being handed to it, adjusting the time, ease in and out may help solve it, or there is a logic error.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [December 14, 2016, 5:44pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/15 "2016-12-14T17:44:29Z")

</div>

Your approach with timelines is unlikely to work, if you want a reasonably physically-based behavior.

You have to consider how fast you want the object to respond when the player turns. If the player does a wrist-whip 180, is the object there right away?

The most robust way to provide “smooth, physically accurate” movement is to use physics simulation.

- turn on physics simulation for the object
- give the object a sphere collider
- turn off gravity for the object (optional but often helpful)

Now, each tick, the object should run logic something like:

1. Determine where it should be (player + player-look-vector + some offset, offset by whether it’s colliding)
2. Determine where it will be 0.1 seconds from now (position + velocity \* 0.1)
3. If the difference is greater than some maximum tolerance, “snap” the object to the desired location, without checking collision
4. Else apply a “thrusting” force at the center of the object that is ThrustConstant \* (should\_be - will\_be)
5. Calculate what orientation the object should have, based on the vector from object to player, and make it have that orientation  
(or, alternatively, run a second desired/actual delta that applies torque to the object to make it spin.)
6. Apply damping to linear and angular velocities. (multiply by (1.0 - 0.1 \* dt) or whatever)

The values of “0.1 seconds” and “ThrustConstant” and “maximum tolerance” are tunable variables in this system.

What you have implemented above is known as a “PD” controller (proportional-derivative) for position.

You can then read up on other ways of tuning this controller, including adding an “I” term (PID controllers, the staple of motion control,) and using differential equations to get the “exact” values to apply when you want the object to “brake perfectly” to get to the position in question with the minimal time possible given a specific available impulse.

If instead you want a “user interface” type behavior, why not just glue the object to the position it needs to be? Calculate the desired position each frame, set the object to that position each frame, done!

---

<div class="post-metadata">

**Author:** ![EXODST](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exodst/32/1031732_2.png) [@EXODST](https://forums.unrealengine.com/u/EXODST)\
**Post date:** [April 1, 2023, 4:33pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/16 "2023-04-01T16:33:47Z")

</div>

Bumping, anyone ever find a solution?

---

<div class="post-metadata">

**Author:** ![Gig4but](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gig4but](https://forums.unrealengine.com/u/Gig4but)\
**Post date:** [June 8, 2024, 1:25pm UTC](https://forums.unrealengine.com/t/problem-with-constantly-updating-actor-location-and-having-it-move-smoothly/80139/17 "2024-06-08T13:25:57Z")

</div>

Updating the position on tick is a sufficient approach. To get “smooth” effect, set the tick group to PostUpdateWork. Interpolation isn’t needed, just set new location to CameraLocation + CameraForwardVector \* Distance.

If you update the position of an object from the player tick function, I recommend not to set this group for player tick. Set the tick function on the exact object or some objects manager.
