G
G
GuitarHero0072020-02-11 10:31:23
C++ / C#
GuitarHero007, 2020-02-11 10:31:23

Unity Determine what is above an object?

Hello everyone
, I have the same problem. I have an object in the game named Finish. And now he is waiting for the player, but how can the Finish understand that the player has stepped on him?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DanielMcRon, 2020-02-11
@GuitarHero007

If in terms of a simple implementation - I entered its zone ... The finish line should have a collider, hang a script on it with the OnCollisionEnter method if it is for 3d, for 2d it is the same, however, this is in the unity documentation.
If it is necessary to pass through the finish line, but at the same time the script would work. Check the IsTrigger checkbox in the collider component and work the same way, but with the OnTriggerEnter
method to the leg area.
But I can guess that you just need to find out the contact, but okay, let it be.

D
Denis Derepko, 2020-02-11
@uDenX

The simplest version of colliders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question