Forum rules - please read before posting.

Player runs off miles out of scene on second entry to scene....

Latest AC. Latest Unity.

This is very odd. On first entry to the scene, the player performs an animation, walks to a marker and speaks dialogue. 
On the second time, a variable switches and the player animates and should move to a marker.

However.

On second entry, he runs of to an unmarkered spot miles out of the scene?!?!

I have tried a process of elimination of removing things, and nothing makes any difference.

The only difference in the action list is that a variable records the player has already been in the scene so bypasses the speech. There is only one player start in the scene. 

Please see video, and action lists.

https://www.dropbox.com/sh/7oim22lkumu1h8j/AAC78UYiz64WTuyY06ebMG1Ha?dl=0

Thanks

James

Comments

  • On the second time, a variable switches and the player animates and should move to a marker.

    Where is your Character: Move to point Action?  I don't see it in your OnStart ActionList?

    You posted Inspectors of two NavMeshes - what are their shapes?

    Open up Char.cs, and find the MoveAlongPoints method (around line 2253).  Insert the following at the top of it:

    Debug.Log ("Moving " + name + " to " + pointData[pointData.Length-1]);

    What's the output of the Console when the player moves off-screen?
  • Hi,

    The nav meshes are normal ( see screenshot)

    Even when I remove the nav mesh from the scene manager, he still runs off.

    Ignore my MoveToPoint comment, he should just animate at PlayerStart and stand sill (like on first scene enter)

    I don't know where exactly to put one of code - I just got errors (see screenshot)

    https://www.dropbox.com/sh/7oim22lkumu1h8j/AAC78UYiz64WTuyY06ebMG1Ha?dl=0

    Thanks

    James
  • The error message does not line up with the code image (please post screenshots, not photos).  The code change is in the right place - save and re-run.  You can post the error message into this thread - open up Unity's Console window to see it in full.
  • Gotcha, code inserted with no error

    Console message is:

    Moving GarlandMEC to (50.4, -0.7, 0.0)
    UnityEngine.Debug:Log(Object)
    AC.Char:MoveAlongPoints(Vector3[], Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Character/Char.cs:2255)
    AC.ActionCharPathFind:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionCharPathFind.cs:134)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:347)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:306)
    AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:522)
    AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:440)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:409)




  • Also, on first time in scene there is no Moving GarlandMEC to console log
  • edited May 2018
    Whether you intend for it or not, a Character: Move to point Action is definitely being run.

    You can use the Actions Manager to show all instances of an Action type in the scene - it doesn't appear to be coming from an ActionList asset file.
  • Even though there is no marker where he is running to? I searched local instances of Character Move to Point and nothing came up
  • In fact, i'm not quite sure how to use this, as i searched all instances and nothing was listed or shown anywhere
  • Also, I changed the action list variable for first time visit scene false to follow the exact same action lists as first time visit true, and he still ran off on second visit to the scene? So how can this be a move to point action?
  • We've yet to find out, but that is what's happening.  There is one there, somewhere, being called.

    Let's try a new Debug log statement that runs whenever a new ActionList is called - it may help reveal that some unintended list is being run.  Inside ActionList.cs, find line 175:

    if (actions.Count > 0 && actions.Count > i)

    Just above it, insert the following:

    Debug.LogWarning ("Running ActionList: " + name);

    What ActionList names appear in the Console when you the issue occurs?  Anything besides the OnStart?
  • Nothing appeared in the console, but interestingly, the OnStart did not appear second time visiting the scene?
  • The only one that showed up was the TurnOnInv

    Running ActionList: TurnOnInv
    UnityEngine.Debug:LogWarning(Object)
    AC.ActionList:Interact(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:174)
    AC.RuntimeActionList:DownloadActions(ActionListAsset, Conversation, Int32, Boolean, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:105)
    AC.AdvGame:RunActionListAsset(ActionListAsset, Conversation, Int32, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:299)
    AC.AdvGame:RunActionListAsset(ActionListAsset, Int32, Boolean) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:256)
    AC.ActionRunActionList:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionRunActionList.cs:158)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:348)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:307)
    AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:523)
    AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:441)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:410)
    UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
    AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:307)
    AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:523)
    AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:441)
    AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:410)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)


    which is use in all scenes and different times. 

    OnStart is still in the scene manager, so it should be running? But it didn't show up in the console log like it did on the first time I visited the scene.

    I then put the same action lists in to another cutscene and put that as an action list to be run on second visit, but the same thing happened.


  • See two new screenshots in original folder - EnteringSecondTimeRunningOff and EnteringFirstTime
  • You have "Collapse" enabled in your Console window, which means the log for "OnStart" is doubling up in its original entry.

    Disable Collapse, and clear it before entering the new scene - so that only the relevant lists are shown.
  • Updated with two new screenshots disabling collapse - they don't show anything untoward. So I've no idea why he runs off?
  • Interestingly, when I turn the Local Variable FirstTimeBackSay to false, he doesn't;t run off. So it is not the ActionList but something to do with leaving the scene and returning. As he still ran off second visit with variable off from start.
  • In which scene is "FirstTimeBackSay" a variable, and in what ActionList(s) does its value have an effect?

    We can use another Debug statement when the Action commands the player, and use it to learn the Marker and scene involved.

    In ActionCharPathFind.cs, find line 120:

    if (pathFind && KickStarter.navigationManager)

    And insert the following above it:

    Debug.Log ("Move " + charToMove + " to marker: " + marker + " in scene " + UnityVersionHandler.GetCurrentSceneName ());

    What's the new result from the Console?
  • Hi, it is a local variable in OnStart, that just checks whether the player has been in the scene before, if not a dialogue action is run, if yes, it skips it. 

    HOWEVER PROBLEM SOLVED!

    For some reason, the player was acting on a marker from the previous scene (Bay), and ace I removed this marker, it solved the problem. The scene Bay was a preload OnStart, so i wonder if this was the issue?

    Anyhow, see new screenshot in folder of console showing that was the problerm

    Thanks for all the help!


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.