How to detect when gameobject is located on another gameobject
Hello everybody,
I build a game (with C#) in which the user have to match balls and boxes according to the colors (for example, matching green ball to green box). I secceeded to make the ball move when dragging it with the mouse, but I want to check if it's located on the right box when the mouse is released and remove the ball if it does.
I don't understand how to check the gameobject that is under the ball gameobject when the user reeleases the mouse.
Thanks in advance.
Is it a 2D or 3D game ? Could you make a drawing of your game ?
If it's a 2D game, you could use collision detection If it's a 3D game, it depends on multiple things, your drawing will give more information to help you
Your answer
Follow this Question
Related Questions
Stop a rigidbody on collide when dragging it with a mouse / with DontGoThroughThings 0 Answers
Empty scene : get mouse position in scene 1 Answer
How do you detect a mouse button click on a Game Object? C# 2 Answers
Destroying GameObject on collision Problems (Begginer) 1 Answer
OnCollisionEnter2D is called after object was shifted 1 Answer