Forum rules - please read before posting.

MoveToPoint callback

Hi,

I'm using AC.Char.MoveToPoint method and I need to know when the character reaches the point and stops. Similarly to the "Wait until finish?" option when using Action List.

In the EventManager there's only OnCharacterEndPath event. So my idea was checking the charState in a while loop and wait until the state is not "Move". The problem is that the state is not immediately switched to "Move" after executing the MoveToPoint method and it would require starting this loop with delay.

Is there a better, cleaner way to handle this?

Comments

  • I think this is what you're looking for:

    while (KickStarter.player.IsMovingAlongPath())
    yield return new WaitForFixedUpdate();

  • You're absolutely right. And also my mistake as I've just found out that OnCharacterEndPath fires after MoveToPoint as well.

    Thanks

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.