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 wrong.
Eventually I got it and this is what I have so far:
(source: own screenshot)

Pretty basic, I know. You can see a red cylinder which is placeholder for an enemy ship, and its trail caster as it flies around. At the minute it just follows me (my spaceship) but in the near future I want to make him fly around randomly and only approach me when I'm within a certain range.

Comments

  1. Hi Pawel,

    I really like your blog ! Ah yes Raycasting, that thing I have no clue what it does and had to add into my game because Unity had a meltdown, Ah memories. I find with most tutorial, you have to mess around with the code to get it to work !

    Ah yes Enemies movements, the biggest pain in the BLANK mainly due to coding. I hate doing any AI for my Game, thankfully you one works !

    Anyway I can't wait to read your blog in the future !

    Y.I.S
    Sarah H

    ReplyDelete

Post a Comment

Popular posts from this blog

Introduction to a Future Revolutionary

Game Vision Statement

Prototype for my space game