I have a OnMouseEnter function that is acting weird.
My set up is a cube with a box collider and a OnMouseEnter function.
When I mouse over the cube, Everything is fine as long as I mouse over on the left side, if I mouse over on the center or the right side of the cube, the cube will not sense that the mouse just entered.
The cube was created inside Unity then I added the texture.
If I use just GUITexture, all is fine.
I am using a cube for a GUI because I’m having a hard time lining up GUITexture when the screen resolution changes.
Attaching an image because I’m not sure if I’m saying this right. :? GUI1 image(Top), mouse over the left side of cube and GUI2 image(Bottom) mouse on center of cube
Cube scale is 0.4(x), .25(y), 0 (z)
Collider size originally was 1,1,1
change it to 1,1,0(z) and mouse over(enter) is at least reaches the center of the cube but still not the whole cube.
An actual cube with a scale of .4, .25, 0 wouldn’t be nearly that long and skinny. So maybe it is an issue with the collider not being big enough. Or is this some custom object? If so, make sure there’s not anything invisible that might be in front of the cube, and if there is, either move it or put it on the Ignore Raycast layer.
So I just did a quick test with a cube, scale of (0.4, 0.25, 0), collider scale of (1,1,0) and position (0,0,0), all worked just fine. And for reference, my cube was most certainly a different shape than yours (as Eric indicated). Just looking at the numbers your cube’s height should be more than half the width and that’s not the case in your images.
@ Eric5h5
Moved the objects to the front of the character, so far it 's better but still not covering the whole cube. Will play with raycasting.
@HiggyB
Created a cube size it at .4.25.0 and yes the size is different than what I have. When I moved that cube to become a child of my character, cube size change to .8, 2.5 ,0, then I adjusted it back to .4, .25, 0. The new cube works fine but once I moved it to position, it has the same problem.
Sorry for being an idiot.
Not about the size,
I had a charactercontroller(collider) from the original FPS that’s causing the problem. As I was adding my own character and colliders, I forgot to remove that thing and it overlaps the boxes.