Hi, im trying to do a script when something happens when you clikc unto a prefab, but it do whatever i click into it, instead when i click and the condition its “true”:
Well, it wasnt the problem, the problem was that i didnt copy my code right, seems, i mean, the script works perfectly, every time i need to click onto the game object, it do the things it has supouse to do, but the problem is that the thing thosent care about if the boolean value its true or not, and thats what i dont understand. Why it dosent stop when i clikc and the boleean its true
“OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider.”
Do you likely need to attach a collider component to the object?
It has a collider and i alredy have it, the Debug.Log, the thing its that it just run the code inside the bollean condition even if the conditional dosent match
That is impossible. I’m pretty sure that the C# if() statements are working properly. You must set your variable wrong.
How do you set it?
And BTW, why are you doing it upside down?
sorry for not answering before, i totally forgot it, yeah, csharp its fine, but i dont know, maybe i tried to make harder than it is, so i restarted all the code in order to achive trhow other way, but thanks a lot for the help