Cursor Affordance not switching

The walkable layer icon shows up when it should, but when i hover my mouse over an enemy, the target layer icon does not show from the cursor affordance script. I followed the tut from the start, but not sure what is causing this.

I keep getting this error:

NullReferenceException: Object reference not set to an instance of an object
CameraRaycaster.Update () (at Assets/Camera & UI/CameraRaycaster.cs:49)

on:

	if (Input.GetMouseButton (0))
	{
		notifyMouseClickObservers (priorityHit.Value, layerHit);
	}

The only solution Unity provides me with is to extract notifyMouseClickObservors, but that doesn’t seem to be a viable fix as it doesn’t make any notable changes. It’s not a compile error, as the code does run, and the walkable arrow shows up.

I have made sure that the main camera has the camera raycaster attached, with the priority levels for walkable and enemy. As well the icons are still visible within the inspector for camera affordance

Got it. Had to put enemy as a higher priority than walkable. Doi

Privacy & Terms