H
H
hipa2021-11-28 19:06:50
Unity
hipa, 2021-11-28 19:06:50

Bug or am I missing something?

I have a GameObject and void OnTriggerEnter.
This is necessary in order to do something when the GameObject touches the map (GameMap).
Here is the script that hangs on the GameObject:

void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent<Collider>().name == "GameMap")
        {
           ...
        }

The problem is that the script registers contact for some reason earlier, although I have observed that their colliders do not.
How to decide?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Konoplyanikov, 2021-11-29
@DeKon

I think the problem is in the line "other.GetComponent().name", should it be "other.gameObject.name" or other.GetComponent()?.gameObject.name

H
Hazrat Hajikerimov, 2015-04-22
@hazratgs

It will work in any case, it's just that most AM2 processors will not fully reveal the graphics capabilities of the video card, more details in this video.

O
OnYourLips, 2015-04-22
@OnYourLips

You need to change the motherboard and processor, modern games require a processor no less than a video card.
I personally encountered such a problem when games slowed down on a video card with a price of under $700 due to a bad A10 processor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question