Trigger not triggering

The OnCollision2d() method isnt working when I use the “boost” trigger in the driver script. If I change the tag of the sprite to package it acts as the rest of the packages work, therefore the sprite is set up correctly. If I cut my code from the driver script and paste it to the delivery script it works accordingly, therefore the code is written correctly when inside the delivery script. It just wont work inside the driver script.

Hi Kontroll,

OnCollision2d() is not a Unity method. Unity’s collision method is spelt with a capital D, for example: OnCollisionEnter2D(). Maybe that’s the problem?

See also:

Maybe your driver script isn’t enable?

I’m new to this site, and I feel like I’m missing some references here.
But generally there are a lot for why collition isn’t working, so I’m just guessing here, more info would be pretty useful.

Thanks. I ended up fixing the issue. I can’t remember what the issue was but It was something to do with exactly where I was placing the code. I will return and complete the 2D course at a later date and hopefully I don’t run into the same issue

I’m glad you fixed the problem. If you encounter it again, make sure to figure out what the problem is exactly and what the solution is. It might well be that it’s one of those common problems. The earlier you gain experience in solving problem, the better because game development and programming are all about problem solving. If you know a bunch of problems and solutions, developing your games will become easier. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms