#Trouble with colliders

1 messages · Page 1 of 1 (latest)

quaint stump
#

So I am having a problem with my "Game Over Zone", which is the red rectangle on the left. When the ball touches it, it is supposed to signal a game over where the ball disappears and the paddle is no longer controllable for the player. Instead, none of that happens when the ball goes through the game over zone.

#

I have also posted the code for all the objects relating to my issue

tawny fern
quaint stump
tawny fern
# quaint stump

Is there a child object here that has the collider? Does it have a collider at all?

#

If there is no collider, that's problem one. No collider, no collision

quaint stump
tawny fern
#

like I said

#

no collider, no collision

#

Problem two - your GameObject here has the tag "Untagged". Your ball code is looking to see if you collided with an object with the tag "Game Over Zone".

quaint stump
#

So how do I create a child object to actually make things collide?

tawny fern
#

you don't need a child object

#

you need a collider

quaint stump
#

And will that solve my collision problem?

dreamy raft
#

it seems like you already have a rb involved. So the only thing left are the colliders, attach a collider with "isTrigger" checked on the gameOver Zone of type 2DBox and then on your script uncomment the OnTriggerEnter part, it should work. You can test it out by simply adding a Debug.Log("it works") on the first line inside the OnTriggerEnter.