I made NPC moving to actor and back to start location, looping. There were 2 issues.
First, NPC was moving only half way and then was going back to start location. I forced it to move all way by increasing greatly Acceptance Radius, but I have no idea why it helped/I doubt it’s proper solution.
Second, I still have not resolved, is issue with distance NPC make. Each time it comes to actor location it stops in slightly different point. It seems a little better since I added clock to project, but not much.
For now movement it’s also not smooth (seems adding clock/speed didn’t help).
This vector may not be what you think it is. You should, at the very least, store that information. Generally speaking, using delays like this is asking for trouble. If something interrupts the movement, the delay will still fire and you’ll have no way to cancel it.
I’ll admit I had no idea about regulating this aspect of sending of message. Now I guess once?.. I’m learning.
Whole chain: spawner spawns resource which sends message (vector, generated by Get Actor Location in Resource blueprint, Pass-by-Ref. via Interface) to NPC which then starts moving towards Resource.
Carefully noting comments about storing of vector and Delays!
So in order to store first vector (one received via Interface) I promoted it to Variable which created Set node. Created vector pin for first AIMoveTo from newly generated Variable from Variable list.
If I delete delays NPC don’t move at all and Print Strings on screen show OnFail result for first AIMoveTo node and OnSuccess for second one.
So far distances are still uneven.
I’ll be investigating Resource sending message part.
(I’m disabling clock for now. I checked, it doesn’t seem to do much now).
Ensure to disable this for now on both the harvesters’ and resource actors’ colliding components. Otherwise you’ll end up with gaps in the navmesh the AI may be unable to reach. You can address this later if it ever becomes a problem.
So, I copied all and checked those boxes.
Now, problem persist BUT now I have normal Acceptance Radius and while NPC is moving whole way.
I have few different components, my NPC was made from template and has skeleton and (non floating) Character Movement Component.
I couldn’t successfully reconstruct adding carried static mesh for now.
I’ll check it all piece by piece bit later, I’m happy it all moved forward.
Yes, after checking various elements I can say again that issue with NPC doing different distance every time is still there. No idea what causes it, perhaps something with Navmesh, but I found nothing so far.
What is achieved is a beautifully smooth movement after replacing Character with Pawn+ Floating Pawn Movement for NPC.