# SetActorLocation is not instant 4.11

**URL:** <https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154>\
**Category:** Blueprint\
**Tags:** lag, setactorlocation, unreal-engine, follow, Blueprint, question\
**Created:** [May 31, 2016, 4:22pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154 "2016-05-31T16:22:16Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [May 31, 2016, 4:22pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/1 "2016-05-31T16:22:16Z")

</div>

When using the SetActorLocation node the movement is not set instantly, there appears to be a lag of a few frames.

To reproduce

1. Set game mode override to none so the default player pawn is used
2. Create an actor blueprint, lets call it Test
3. Open the blueprint editor for test and create a cube objects as a child of root, set the x position of the cube to be -300
4. Set Test to follow the player like so

 ![92753-screenshot_053116_051940_pm.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/c/4ac26239f398a51b7cd9ca5665eb3a55b08bcb58.jpeg)

1. Play and move around

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [May 31, 2016, 7:22pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/2 "2016-05-31T19:22:36Z")

</div>

Hey Hmb3141-

Can you include a short video of what you’re seeing? I followed the setup steps you provided and the cube was following all of my character’s movements (running, jumping, etc) smoothly.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [June 1, 2016, 1:09am UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/3 "2016-06-01T01:09:49Z")

</div>

What you See on the Cube is most likely TemporalAA (Anti-Aliasing, Change to none under Project Settings-\>Rendering)  
And regarding the Shadow thats Motion Blur (Also under Project setting-\>Rendering)

Turn both off and you wont notice anything anymore. Its just purly Visual the Set Location happens instantly.

---

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [June 1, 2016, 9:16am UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/4 "2016-06-01T09:16:43Z")

</div>

[![]( " - YouTube") ](https://www.youtube.com/watch?v=m0cS7jTbqp4)

---

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [June 1, 2016, 9:17am UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/5 "2016-06-01T09:17:25Z")

</div>

I tried disabling both of these but I still see the same thing. Here’s a video of what I’m seeing [- YouTube](https://youtu.be/m0cS7jTbqp4)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [June 1, 2016, 1:28pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/6 "2016-06-01T13:28:12Z")

</div>

Keep in mind that you are setting the new location on tick. As you move, the cube’s location will update on the following tick after it registers the change in location. If you place the cube at the world origin (0,0,0) and use SetActorLocation on a keypress to another location (100,100,100) the cube should move instantly.

---

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [June 1, 2016, 1:42pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/7 "2016-06-01T13:42:57Z")

</div>

So, is there a solution where I won’t see this delay?

I would imagine that even with one frame behind there should barely be visible difference anyway running at 60fps

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [June 1, 2016, 1:58pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/8 "2016-06-01T13:58:49Z")

</div>

Rather than using Set Actor Location you can try using AddActorLocalOffset. This will move the actor by the specified values in the given direction. So a value of (1.0 , 0.0 , 0.0) would end up moving the actor along the X axis at 1 unit per tick.

---

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [June 1, 2016, 2:20pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/9 "2016-06-01T14:20:09Z")

</div>

So to get an object to follow another object I would have to check the change in transform from the previous frame and apply this offset to the cube.

Surely there is another way, is this lag the expected behaviour or is it possible I’m doing something else wrong?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [June 1, 2016, 3:10pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/10 "2016-06-01T15:10:10Z")

</div>

Here is a quick setup that causes the blueprint actor to follow the player until it gets within a certain distance of the player and then stop. Note that it uses AddRelativeLocation rather than SetActorLocation to move the actor.

 ![92869-followenemy.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/1/62185f030a315b0a5d5a99453348d8f47d04827f.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7201149f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7201149f](https://forums.unrealengine.com/u/anonymous_user_7201149f)\
**Post date:** [December 8, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/11 "2016-12-08T20:28:06Z")

</div>

this doesn’t work. Is there really no built in way to accomodate a prediction for velocity when using setactorlocation?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7201149f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7201149f](https://forums.unrealengine.com/u/anonymous_user_7201149f)\
**Post date:** [December 8, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/12 "2016-12-08T20:28:35Z")

</div>

you ever figure out a solution? This problem seems absurd

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7201149f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7201149f](https://forums.unrealengine.com/u/anonymous_user_7201149f)\
**Post date:** [December 8, 2016, 8:46pm UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/13 "2016-12-08T20:46:26Z")

</div>

So I found the actual answer, the trick is to make sure your event tick for “set actor location” is in the right tick group. The blueprint key is “set tick group”, most likely to the “post physics” tick group. Works like a charm.

---

<div class="post-metadata">

**Author:** ![Hmb3141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hmb3141](https://forums.unrealengine.com/u/Hmb3141)\
**Post date:** [December 9, 2016, 11:41am UTC](https://forums.unrealengine.com/t/setactorlocation-is-not-instant-4-11/359154/14 "2016-12-09T11:41:13Z")

</div>

Yeah, this is perfect. Thanks!
