Box Colliders and OnMouseEnter

Hi

I am having a bit of frustration with something that I guess is very simple when you know how!

I am trying to highlight particular parts of a board when the player puts their mouse over it, see image below (the red highlighted point):

I created a basic model and attached a box collider (and later a mesh collider) to it. I then used the following script:

private void OnMouseEnter()
	{
		if(Selectable)
		{
			renderer.material.color = SelectedColour;
		}
	}
	
	private void OnMouseExit()
	{
		if(Selectable)
		{
			renderer.material.color = NormalColour;
		}
	}

The strange thing is the collider only seems to work when I run the mouse down one side of it.

Any ideas why this might be, or even better… a better implementation for my task.

Thanks in advance.

John T

I placed the prefab in an empty scene and it worked fine. I realised that other colliders were interfering with the trigger.

I placed the other colliders in the Ignore Raycast layer.

Ta

John T