x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

SetActorLocation is not instant 4.11

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

alt text

  1. Play and move around

Product Version: UE 4.11
Tags:
more ▼

asked May 31 '16 at 04:22 PM in Blueprint Scripting

avatar image

Hmb3141
31 3 8 12

avatar image Doug E ♦♦ STAFF May 31 '16 at 07:22 PM

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.

avatar image Jarbles Dec 08 '16 at 08:28 PM

you ever figure out a solution? This problem seems absurd

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Jun 01 '16 at 01:09 AM

avatar image

Nachtmahr
7k 143 28 172

avatar image Hmb3141 Jun 01 '16 at 09:17 AM

I tried disabling both of these but I still see the same thing. Here's a video of what I'm seeing https://youtu.be/m0cS7jTbqp4

avatar image Doug E ♦♦ STAFF Jun 01 '16 at 01:28 PM

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.

avatar image Hmb3141 Jun 01 '16 at 01:42 PM

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

avatar image Doug E ♦♦ STAFF Jun 01 '16 at 01:58 PM

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.

avatar image Hmb3141 Jun 01 '16 at 02:20 PM

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?

avatar image Doug E ♦♦ STAFF Jun 01 '16 at 03:10 PM

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.

alt text

followenemy.png (310.7 kB)
avatar image Jarbles Dec 08 '16 at 08:28 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Dec 08 '16 at 08:46 PM

avatar image

Jarbles
123 9 12 18

avatar image Hmb3141 Dec 09 '16 at 11:41 AM

Yeah, this is perfect. Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question