Box Collider 2D

Andrew Lengen
May 28, 2021

Now that we have the basis set-up, let’s get our “Edit Collider” in our Box Collider 2D to match the size of our ship(s) more!

Now that we have the correct sizes for our colliders, if we play-test we notice one big thing… the collision still does not work, why? OnTriggerEnter(), which is used in 3D-triggered collisions. An easy fix!

Head into our “Enemy” script, and change OnTriggerEnter() to OnTriggerEnter2D() and change our “Collider” inside of the method to “Collider2D”. Save the script, play-test and… we are almost there. We just need to get the lasers working!

I’m firing my lasers and they’re not working!

--

--

Andrew Lengen

If ambition and practicality amalgamated, it would be me! I am here to climb the mountains of my ambition and catalog my journey so that someone can be changed!