I’m currently using the wiimote to make a FPS and I want to equip the warrior when I place the crosshair over the texture2d of the weapon draw in the menu of equipment. But the code that I have seems to do the action even if I’m not over the texture. I think I cant use gui.button cuz this makes action only with the click of the mouse, so I created this code, does anyone knows why is not working?
var temp_x = ((Movementwii.fromWiimoteIRX) ) *Screen.width;
var temp_y = ((-Movementwii.fromWiimoteIRY) * Screen.height);
temp_x = Mathf.RoundToInt(temp_x);
temp_y = Mathf.RoundToInt(temp_y);
IRx=temp_x+CrossHairMenu.width/2; //Guess this IR point at the center of the crosshair if im wrong please tell me
IRy=temp_y-CrossHairMenu.height/2;
GUI.Label( Rect (temp_x, temp_y, 64.0, 64.0), CrossHairMenu);
if ((temp_x>=ItemMenuOffset.x||IRx<=ItemMenuOffset.x+ItemMenu.width)( temp_y>= (nativeVerticalResolution - HiltMenu.height - ItemMenuOffset.y)||IRy<=ItemMenuOffset.y+ItemMenu.height))
if (Movementwii.fromWiimoteA==true)
print("over item");
}