Support Forum

Look at on path completion not working

I have my player
AIPath, Seeker, Character Controller
Funnel Modifier, Simple Smooth

On the camera, I have the “target mover” script slightly modified.
When I click on the ground anywhere, i move to it, as normal. but if i click on an ‘interactable object’ it still mostly behaves the same, except I tell the player that we are walking to something to interact with.

During which I register function to be called inside of
OnTargetReached() inside the AIPath

Which basically calls

      Quaternion LookAt = Quaternion.LookRotation(InteractibleObject.position);
       transform.rotation = LookAt;

Now, this works 100% correctly. However its ‘constnatly being executed’ so i thought to unregister it, once it looks at it ‘once’

now, when it reaches the target, it snaps looks at the object, then snaps back to original after what appears to be at least 1 full frame.

Something is resetting its position somehow, and i believe its perpetually calling ‘pathcomplete’ when its not moving anywhere.

What do I need to do, so that it can call it once, looks at it. And thats that?

Ive been digging around to figure out if I need to turn off something when I am trying to ‘interact’ (i.e. read a sign, chop a tree, mine some ore)

I realized it was being of the constant repath rate that was changing it.

Then instead of adding in a bunch of hackish code. I realized it was SUPER easy.
I just needed to set the “Exact end point” to “original” instead of “closest on node”
that was what was pulling it to not look at my ‘target’