Forum rules - please read before posting.

Random crashes when using Character: move to point

edited December 2015 in Technical Q&A
Simple, create an interaction, marker and object.
Add player component to your object.
In the interaction set your character/player to move to your marker.
Execute it and wait few seconds. The crash is random but very very often, alsmost all the time.
I get this crash error:

transform.position assign attempt for 'Slab02Found' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Transform:set_position(Vector3)
AC.Char:MoveUpdate() (at Assets/AdventureCreator/Scripts/Character/Char.cs:836)
AC.Char:_Update() (at Assets/AdventureCreator/Scripts/Character/Char.cs:426)
AC.Player:_Update() (at Assets/AdventureCreator/Scripts/Character/Player.cs:163)
AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:318)


Here is the crash picture

http://postimg.org/image/kxa335gu1/full/

Before the latest update I used 1.47 and it was fine.

Comments

  • Not so simple, in fact.  Following your steps produces no such error for me.  What does your Settings Manager look like, particularly the Movement settings?
  • I'm afraid it doesn't.  Please place a problematic player/NPC in a test scene that shows this off, and PM it to me.
  • edited December 2015
    Sorry, but the problem persists using AC 1.50a  Unity 5.2.4f1 :(
  • Re-post the Console message in full - it may be different this time.
  • Yes, you are right it is a bit different this time. Char.cs: 841
    I used the same scene I PMed you.
    Now using Unity 5.2.4f1 AC 1.50b

    http://s18.postimg.org/cigho2849/Capture.jpg
  • I can't recreate it - what once gave an error doesn't any more.

    If you're up for it, you should be able to debug this yourself - the issue is that the variable "newVel" in Char.cs is being divided by zero - thus turning the newVel into infinity.  It's set in the MoveUpdate function, and you can see on line 782 that there's a check in place to ensure this doesn't happen.

    Since the issue seems unique to your project, try inserting Debug.Log commands to find out at what point this occurs.
  • edited January 2016
    What Unity version do you use?
    I have uneasy feeling all the new troubles come from Unity's version that I updated.
    I usually don't have any problems with AC but since the update from AC 1.47  and Unity 5.1.1f1
    several things have been f up.
  • I try to keep on top of all of them.  I tested your scene in 5.0.1 and 5.3.1.
  • edited January 2016
    Ok, I think the problem is solved and sort of isolated.
    I just simply copied my Manager's settings movement from the old AC to the new AC, which on update were changed. Though I loaded my old managers... but there are new features there so it might have changed them or affected somehow.
    http://s28.postimg.org/x5nt1pqxp/Capture.jpg

     However if the settings are different then Character objects must have Deceleration greater than Acceleration in movement settings of your Character object. And if for some reasons after you will get a Null object error, then you must create a navmesh 2d and add it to you Scene settings in Scene AC tab by default, and stretch it wide so it covers all your charcter objects and markers.

    What a  journey...
    I will never ever update anything in my life :)
    Thanks for your 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.