Forum rules - please read before posting.

Issue with paths

2»

Comments

  • I have a trigger that changes camera and locks a player to a path on entry and then disables itself. Here's the trigger's setup and actionlist: https://drive.google.com/file/d/1Z6CHci8zFazvcRFG-K_xyOfNssS-etfc/view?usp=sharing

    I have an intersection area where the player can move freely. When selecting a route, a trigger locks the player on path. The intersection works well if the player is snapped to a first node of a path. The screenshot above is from a trigger which would lead the player back to the start of the level, but the player doesn't snap to a path. The other triggers on the intersection work fine, but they'll snap the player to the first node of the path.

  • Recreated - I can amend this so that the character snaps to the last node facing backwards in this scenario.

  • Cool! So Snap to Nearest will fix this? Were you able to recreate the random freezing of movement?
  • edited October 2021

    No - it may be very specific to your Path / setup. I will need clear steps to reliably recreate it.

  • This behavior occurs in two separate projects. I use terrain in both, and AC player characters which have been made with the Character Wizard. Navmesh is baked in both terrains. Both projects also use Cinemachine. The usually happens when the direction of movement is changed.

  • How closely do the Path nodes stick to the terrain? Please share screenshots.

  • That actually might be the reason why this happens: some of the nodes are under the terrain and some quite high. I'll adjust the nodes to hit the ground. I reckon they should rather be above than below the terrain?

    I thought this wouldn't matter, but it seems quite obvious now :D

    Thanks!

  • Okay! I'm having some issues again with paths :)

    I have a long corridor, where the player should move in one node to another. I have a trigger set for this sequence. Entering the trigger should snap the player to the nearest node so that the corridor can be travelled both ways. The path works just fine when the path snapping is from the start, but when I use Snap to Nearest, I get the following:

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    AC.PlayerMovement.DirectControlPlayerPath (UnityEngine.Vector2 moveKeys) (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:841)
    AC.PlayerMovement.UpdatePlayerMovement () (at Assets/AdventureCreator/Scripts/Controls/PlayerMovement.cs:105)
    AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:253)

    And

    Invalid node target - cannot update pathfinding on AKITA DEFAULT PLAYER

    -> AC debug logger
    UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
    AC.ACDebug:LogWarning (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:33)
    AC.Char:PathUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:787)
    AC.Char:BaseUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:643)
    AC.Player:_Update () (at Assets/AdventureCreator/Scripts/Character/Player.cs:179)
    AC.StateHandler:Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:276)

    I have baked the navmesh and made sure the nodes are above ground

  • Which is the nearest node the Player is snapping to? One of the ends, or one in the middle?

  • One of the ends, it's a straight line

  • Okay, I added some nodes to the path, total of four. The same exact behaviour occurs when trying to set the player on path on the opposite side of the corridor

  • So far as I can tell, this is related to the same issue on 12th. PM me if you'd like to be involved in testing the potential fix.

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.