I cant figure out the colision

i have followed your steps on the c# course but the colishin is not working

Hi peanut,

Welcome to our community! :slight_smile:

In which course and lecture are you? Please share more information on what you did and have in Unity, so we will be able to assist you.

Complete C# Unity Game Developer 3D Online Course

Thank you. What did you expect to happen? What happened instead? What did you do in your project? Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Are there any error messages in your console?

Please bear in mind that we usually have got dozens of videos in our courses, and collisions in almost all games. Without any further information, it is impossible to tell what might have gone wrong in your project.

I thought that the collision would work but when I hit the wall I just pas thru it I followed the steps very closely and cant figure out what is going on.

I still do not know in which section or lecture you are. Is it the Obstacle Course? If so, try to slow the player down because Unity cannot handle fast moving objects well.

it is the obstacle course and I have already tried slowing the player down it dose not work.

Could you please share screenshots of what you see in Unity? Do the player and the other game objects have got colliders attached? “Is Trigger” must not be enabled if you expect “physical” collisions because trigger colliders do not have any “solid” body.

here is a screenshot

Thank you. I’m also interested in the respective Inspector of the relevant game objects. Bear in mind that I’m not sitting next to you and that I don’t know anything about your project apart from the few things you shared here in your thread. To allow me to understand what you did and what the problem might be, I need more information.

this is the inspector

The Inspector of which game object? To make a collision happen in Unity, you need at least 2 game objects with a collider.

Maybe you’ll find a solution faster if you simply rewatch the video and compare your settings to Rick’s. There is probably a difference between your game and his.

the wall it is coliding into

Is that supposed to happen? If not, what did you expect to happen?

We still need to see screenshots of the player collider and see your collision code.

Posting a screenshot of your physics settings in Edit → Project Settings → Physics could be helpful too. There are some settings we could change later to help with high speed collisions, but I’d like to rule out other problems first.

Can you share your code and screenshots of both inspectors?

that is not supposed to happen it just passes though the walls. what should happen is the walls block its movements.


here is the code

Does “Bump!” appear in your console? If not, there is a problem in the scene. In that case, you’ll have to check all colliders and their respective size. “Is Trigger” must not be ticked.