#Collision issue
1 messages · Page 1 of 1 (latest)
A thread to stop this issue overrunning the channel
if (collisionInfo.collider.CompareTag("Obstacle"))
{
Debug.Log($"Tag: {collisionInfo.collider.tag}, Name: {collisionInfo.collider.name}, GameObject: {collisionInfo.gameObject}");
}```
yesha
bro
bro what
i changed it to collider.name
i want it when it hits obstacle only to log that message, not the ground
this is the entire code your supposed to use... idk what else your changing
and see the results of it
Also, I figured out what the original issue was
unity thinks the ground is an obstacle too
🔍
so when it hits the ground then it will log
the ;
your if statement is doing nothing
i removed it
You don't know this. Which is why we're trying to get you to log the information about the collision
if you just used the above code then you would gain that info
no, all you had to do was use the debug.log correctly
then you would know the code always runs, then you would know that the if statement is ignored, then you wouldve seen the ;
im new so i didnt knw that if statements didnt need ;
Also looking closer your IDE would have been underlining that area, saying you have a mistaken empty statement