Forum rules - please read before posting.

Face after moving not instant?

I am developing a 2D point and click adventure game and in my playable character (Player) component I have the following properties:

  • Turn speed: -100
  • Turn before pathfinding? true
  • Retro-style movement? true

I have set the turn speed to a negative value as the Turn() method of the Char.cs set the isInstant flag to true internally for negative turnSpeed values.

Essentially I want my character to turn instantly at all times.

This however is not the case when a Hotspot interaction is set and the 'Player action:' is set to 'Walk To Marker' with both the 'Cutscene while moving?' and 'Face after moving?' flags turned on.

The character moves to the marker and then the 'Interaction' run while the character moves to the direction of the marker, in a non-instant manner.

Is this a bug or is there something I need to configure differently to have the player character turn instantaneously before the Interaction runs?

Comments

  • What is your AC version? I cannot reproduce such an issue.

    If you're looking inside the code, try placing a Debug.Log statement inside the Turn function to show the value of isInstant - is it showing as false while the issue occurs?

  • Ah yes, apologies. I am on version 1.85.5 (latest).

    It's a bit hard to debug this using a Debug.Log statement as the Turn() function gets called in every frame (via the StateHandler:Update() as far as I can see from the call stack).

    Placing a Debug.Log after the if statements at the beginning of the function that can change the value of the isInstant to true, I can see that the value of isInstant is always True but the character keeps turning with a delay.

    Some more information regarding my Player configuration:

    • Animation engine: Sprites Unity Complex
    • Facing directions: Custom (Left, Up-left, Up-right, Right)

    The issue doesn't always manifest. One way I was able to get a fairly consistent reproduction is to keep the player character idle looking at the Right direction, have a hotspot with a Use interaction on their left (even with no Interaction assigned - screenshot below) and then click on the Hotspot that will force the player to pathfind to the marker and turn.

    The marker has a Z rotation of 45 which tells the character to turn to Up-Left. In more than 50% of the cases the character pathfinds to the assigned marker, stops, turns Left and then Up-left after a brief delay instead of Up-left immediatelly.

    interaction screenshot

  • Actually, I found the issue and it was on my (rather complex) animator graph: An animation clip is playing back after the character finishes with their walk cycle animation and this way the reason of the delay.

    Feel free to close/delete this post is needed. Thank you and apologies for the time spent!

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.