About 'Make Player Shoot'!

In this video (objectives)…

  1. Create a projectile and connect it to the player.
  2. Instantiate a the projectile using GetButtonDown().
  3. Give the projectile some velocity so that it shoots upwards.

After watching (learning outcomes)… Instantiate a project and shoot it upwards.

(Unique Video Reference: 7_LD_CUD)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Hello Rick,

I just wondering what is the function of ‘as GameObject’? Cuz I tried not to use it and it still works. Thank you

Usually we “cast” something using “as GameObject” so that we can then later use that game object to do something else with. If you want to dig deeper into this, google around for “casting” in Unity and C#.

Thank you for the answer Rick. Actually I’ve been searched it on Google before you answer the question lol and it took me hard to find the keyword, but I finally knew it as a “Cast”. There are a lot of type of Cast in C#, are they all used in Unity?

I cant comment if they are all used in Unity, but I do know that casting is a pretty common approach.

Privacy & Terms