Forum rules - please read before posting.

NPC Follow problem - NullReferenceException: Object reference not set to an instance of an object AC

Ive set up a navmesh etc and I want to get an NPC to follow the player but I get this error:

NullReferenceException: Object reference not set to an instance of an object
AC.NavigationEngine_PolygonCollider.GetPointsArray (Vector3 _originPos, Vector3 _targetPos, AC.Char _char) (at Assets/AdventureCreator/Scripts/Navigation/NavigationEngine_PolygonCollider.cs:104)
AC.NPC.FollowMove () (at Assets/AdventureCreator/Scripts/Character/NPC.cs:250)
AC.NPC.FollowUpdate () (at Assets/AdventureCreator/Scripts/Character/NPC.cs:219)
AC.NPC.FollowAssign (AC.Char _followTarget, Boolean _followTargetIsPlayer, Single _followFrequency, Single _followDistance, Single _followDistanceMax, Boolean _faceWhenIdle) (at Assets/AdventureCreator/Scripts/Character/NPC.cs:350)
AC.ActionCharFollow.Run () (at Assets/AdventureCreator/Scripts/Actions/ActionCharFollow.cs:74)
AC.ActionList+<RunAction>c__Iterator2.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:329)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:293)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:485)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:398)
AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:367)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Comments

  • In what version of AC?  In the current release, that would indicate you either don't have a "Default NavMesh" assigned in your Scene Manager, or that NavMesh has no PolygonCollider2D component.
  • Oh yes I dont have a default navmesh! Sorry, but how do you assign a navmesh like that?
  • In the Scene Manager - see this tutorial.
  • Thank you, will check it out, it might seem like I dont read the manual but I do really, it is open all day on one monitor :-)))
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.