I hope someone can help me with this, get this error message in Unity 2017 when i trying to navigate to enemy and on the ground so i can’t move at all.
“NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.ProcessMouseClick (RaycastHit raycastHit, Int32 layerHit) (at Assets/Player/PlayerMovement.cs:47)
CameraRaycaster.Update () (at Assets/Camera & UI/CameraRaycaster.cs:49)”
and
"NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.ProcessMouseClick (RaycastHit raycastHit, Int32 layerHit) (at Assets/Player/PlayerMovement.cs:42)
CameraRaycaster.Update () (at Assets/Camera & UI/CameraRaycaster.cs:49)
"
if i click on the problem it says it something wrong with this code in Playermovement.cs:
aiCharacterControl.SetTarget(enemy.transform); and aiCharacterControl.SetTarget(walkTarget.transform);
but could it be something with the layer in main camera? thankful for help.
/Anton