- Home /
IOS touch vs OnMouseDown & error messages
Hey Guys, Currently i have an ios project that uses all OnMouseDown methods instead of specifically touch inputs methods, it seems to work fine and i can test it on the computer and on my iphone. It works great but when i go to build it i get the warning: Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices. UnityEditor.HostView:OnGUI()
This is an example of a raycast im using:
void Update(){
if (Input.GetMouseButtonDown(0)){
Ray ray = camera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit)){
objectRayHit = hit.collider.gameObject;
if (objectRayHit.name == "1OrangeCube" && DataManagement.datamanagement.playerSuitColor != 1){
DataManagement.datamanagement.playerSuitColor = 1;
}
and this is an example image of the scene im using this in:
Why am i getting this error? my game is a very simple game and it seems to work fine but obviously i want to release it with the best coding i can muster. Any help will be greatly appreciated.
There is a similar unanswered question here: http://answers.unity3d.com/questions/669282/performance-impact-of-onmouse-event-handlers-on-mo.html