Priority Layer not being found

Odd, I’m pretty sure I have every script attached where it should be. Yet I’m getting an issue where the Raycaster script is not finding a topPriorityHit. What might be the cause of that?

  RaycastHit? priorityHit = FindTopPriorityHit(raycastHits);
    if (!priorityHit.HasValue) // if hit no priority object
	{
		NotifyObserersIfLayerChanged (0); // broadcast default layer
		return;
	}

If I change the “0” in the method call to, say, 8 then I get the walkable cursor.

Okay, I must have missed it in the lecture, but it seemed I needed to setup the layers in the camera raycaster editor window in the inpector. I set it to 3 levels: 0 Enemy, 1 Walkable, 2 Default.

this MIGHT be a work around. So I’ll leave it as [unsolved] for now.

Privacy & Terms