OnCollisionEnter

Good morning people, I’m tackling the lecture from the obstacle course project and i have some questions about the OnCollisionEnter method. From what i’ve see in the video, the teacher uses it with the parameters: OnCollisionEnter (Collision other) while both in my editor and Unity api every section about this method states that it uses the (collision collision) parameters

what’s the difference between collision other and collision collision?

The only difference is the declared variable name.

It’s like the difference between:
int addedValue;
and
int subtractedValue;

They are both integers, but the variable is called something different.

The same with this, they’re both of the type Collision, but the programmer changed the name on that implementation.

oh i get it, i was getting so confused since when i studied c# at college teacher also used always other and i assumed it was saying that if any other collision comes into contact with the one containing this script then execute the functuonality coded within. So they were just variable names, gosh thanks for clearing it out Michael :slight_smile:

1 Like

Privacy & Terms