Collision Problems

Updated on July 13, 2017 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
12 on July 12, 2017

http://imgur.com/EAi4xHW

I’ve encountered this error while trying to add collisions to my game, following Brackeys’ How to make a game series. It wasn’t happening before, but having fixed my original problem, this one arose. I have not idea what this means. Any help is greatly appreciated, thanks

  • Liked by
  • Mossy145
Reply
0 on July 12, 2017

You probably have it like this:

private void OnTriggerEnter (Collider collider) {}

Change the parameter to be of type Collision:

private void OnTriggerEnter (Collision collider) {}

  • Liked by
Reply
Cancel
1 on July 12, 2017

What is the parameter? Sorry, I’m new

Devoted
on July 12, 2017

Collision collider

Show more replies
  • Liked by
Reply
Cancel
0 on July 12, 2017
  • Liked by
Reply
Cancel
7 on July 12, 2017

If you don’t know what parameters are you should go back to C# basics.

on July 12, 2017

I was following the beginner video because I thought it would run me through how to do everything, this is the only thing I’ve had any trouble with, just need help with this particular issue as his code isn’t working for me, I’ve already had to change a bit thanks to a very helpful user, it’s just this particular instruction that seems to be the problem.

Helpful
on July 12, 2017

He gaved you the code you need, please check that first and if you don’t understand you have to start learning C# without Unity to understand the Unity coding part.

on July 12, 2017

It wasn’t the right code :/ if it was I’d hope that’s fix it, no clue what’s wrong

Devoted
on July 12, 2017

It is the right parameter. The difference is the method name. If you don’t understand such basic concept you should first learn C# and not just blindly follow tutorials.

You can’t to fishing if you don’t know how to hold a rod.

If you continue to just follow tutorials without understanding basic concepts you’re going to run into a lot of trouble later down the road as much advanced stuff is taught.

on July 12, 2017

If it’s simple can you tell me how to fix it so I can understand what’s wrong?

Devoted
on July 13, 2017

Just…. ugh… just go learn C#.

on July 13, 2017

I spent all last night learning it, and managed to fix it myself…so…thanks..sorta

 

Show more replies
  • Liked by
Reply
Cancel