Unity Free Tutorials
This week in Unity I added raycasting to my spaceship's weapons, instantiating explosions and enemy movement. Raycasting is basically the game checking if the player hits something with their weapons. I followed a tutorial and added a script to do just that. (source: own screenshot) As you can see, each laser has a separate script so they don't all have to hit or miss at the same time. It took a bit of messing around with the code but I got it eventually. Next I added instantiated explosions. This basically adds a particle "fire" effect to an object when it's shot. (source: own screenshot) As you can see, it's pretty basic at the moment, but as the guy in the video said, "once we add some proper particles to it, it's gonna look pretty cool" Next up, we created a script for the enemy movement. This one was a bit of a pain in the ass, because it just kept giving me compile errors and I couldn't figure out what's wro...