Itération 122442
Itération 122442

Reputation: 2962

Unity3d detect the click on a plane

I'm trying to detect when the user click on a plane in C#. I tryed OnMouseDown() but it has no effect.

According to some topics on the web, the object must have a collider, but my plane has one.

I also found topics talking about raycast, but I must admit I don't really understand what it is and what it does. Could someone lead me to a good and (relatively) simple exemple that explains well how to do what I would like to do?

Thanks, have a good day

Upvotes: 2

Views: 779

Answers (1)

Andrea
Andrea

Reputation: 6125

From my previous comment, the plane was marked as Trigger.

"This function is called on Colliders marked as Trigger if and only if Physics.queriesHitTriggers is true." from here.

Upvotes: 3

Related Questions