D
D
Dmitry Korolev2016-07-05 22:48:05
C++ / C#
Dmitry Korolev, 2016-07-05 22:48:05

How to write OnCollisionEnter()?

pastebin.com/NT4sdd9L
gives Script error: OnCollisionEnter
This message parameter has to be of type:
The message will be ignored.
why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2016-07-06
@adressmoeistranici

OnCollisionEnter there is a collision parameter, not a collider. Collisions don't have tags or anything.

oid OnCollisionEnter(Collision bullet)
    {
        if (bullet.(ТУТ УЗНАТЬ КОЛЛАЙДЕР ИЗ КОЛЛИЗИИ).CompareTag("Ring"))
        {
            r = true;
            Debug.Log("R");
        }

and further by analogy. Collision - in fact, just infa about intersection points.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question