The bot turns around along a long path

Hello, I made the Bot turn to face me every 3 seconds. It works, but there is one thing: for some reason it sometimes unfolds along a different path, when it is much longer and I cannot understand what is wrong and how to fix it. Attached video and script.

The script issues:

  • you’re running a Delay inside the Timeline Update which executes every frame
  • the way you access actors is unsafe
  • resampling timeline data during updates is inconsistent
  • restarting the timeline after a delay during the update makes no sense whatsoever

This whole thing is a bit of a mess. :innocent:

The confusing part:

it sometimes unfolds along a different path, when it is much longer

Not sure what this means. It rotates the wrong / longer way?

The important bit:

How is it supposed to work? Every 3 seconds the bot looks at us and then looks away?

What a coincidence! I encountered the same problem recently :smiley: and I came up with this:

(You don’t have to multiply the output float value before plugging it into the alpha pin of the lerp node btw if you set the timespan of your timeline to be 1 second)

I also think OP means that. If I understood your objective wrong though, please clarify @mxmodx

Lerping a rotator solves this issue automagically:

image

1 Like

Wow really? I knew there could be a better way to solve this! Thankss :heart:

Yes :rofl: definetly magically, I don’t know why I couldn’t think about this myself!

1 Like

Thanks, this function worked as expected.

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