The function OnMouseDown work perfectly with standart oriented objects. But, if this object fall, this function doesn’t work.
Why?
I try a diffirent types of colliders, i try Trigger and not. What I miss? I think the bug is in colliders orientation. Is it?
Make sure you are calling it in Update(). It does not work reliably in FixedUpdate().
I’m a stupid muse! I jast today talked about this to my friend!!!
O-o-o-o I’m unmercy and inexcusable stupid muse!
But how can I call this function from FixedUpdate()?
The problem is not in “FixedUpdate” call, but in builtin OnMouseDown() function.
I meant which function you are calling it from
void FixedUpdate()
{
OnMouseDown();
}
is unreliable, but
void Update()
{
OnMouseDown();
}
Works correctly.
OnMouseDown () can be called inside other function ?
Very interesting. I’ll try right now…
function OnMouseDown() is called by the engine when mouse click on collider is happend. Not in other times.
If I’ll call this function from other function, I’ll lose all functionality of this method.
This is wrong way.
Dang…wasn’t paying close attention. I was thinking of Input.GetMouseButtonDown(). Sorry about the confusion.
I don’t have any useful ideas for you, unfortunately.
Thanks for trying, men!