This is very odd!
I have a code block that looks like this:
It's in the Update() function of a script attached to a prefab.
If I create a copy of the prefab at runtime. There's no problem. DoSomething is called when the mouse is clicked.
If I have a prefab in the scene, click play, then step through in the debugger and click on the mouse, I can see that the execution steps into the block but DoSomething is not called and execution falls through to "int value = 0;"
The code then continues as expected. No exceptions are thrown. Nothing seems amiss.
Anyone know why this might be happening?
(if I replace Input.GetMouseButtonDown with any other true statement then DoSomething is called fine)
asked Jul 08 '11 at 11:59 AM
I have found that if
answered Aug 05 '11 at 10:03 PM
I have found weird issue, if scene has no camera tagged "MainCamera" (so Camera.main is always null) my mouse events doesn't work at all.
answered Aug 05 '11 at 10:07 PM