Join Dan Violet Sagmiller for an in-depth discussion in this video Base creates drones, part of Build a Real-Time Strategy Game with Unity 5.
- [Voiceover] One of the final actions…we need to give the player…is the ability to create more drones.…Of course those drones can create more bases…and those can create more drones and so on.…To start this all off, I'm gonna go into the Scripts folder.…In the Scripts folder, I'll find the Actions folder…and go in there.…And inside of the Actions folder,…I'm gonna create a script called CreateUnitAction.…Now let's edit CreateUnitAction.…In CreateUnitAction, the first thing I wanna do…is make this an action behavior.…So, I'll set it to ActionBehavior.…
Next, I need to give it a couple public variables.…I'll start with a prefab,…public, GameObject, Prefab.…This is gonna be the drone that it'll create.…Next, how much does this drone cost?…Public, float, Cost equals zero.…Next, I need to know the player definition.…So, private, PlayerSetupDefinition,…player.…
In the Start function,…I'm gonna get access to that player.…So, player equals GetComponent,…Player.Info.…I don't need the Update function,…so I'll just get rid of it.…
AuthorDan Violet Sagmiller
- Adding player positions and start info
- Loading prebuilt levels
- Adding camera moves
- Adding a unit
- Supporting navigation
- Adding unit owners and player objects
- Importing and setting up a HUD map
- Adding unit info and credits
- Creating HUD actions
- Building a command base
- Adding artificial intelligence
- Adding battle actions
Skill Level Intermediate
Unity 5: 2D Essential Training (2015)with Jesse Freeman3h 22m Intermediate
1. Initial Setup
2. Adding a Unit
3. Navigation Mesh
4. Unit Owner
5. HUD Map
6. Unit Info & Credits
7. HUD Actions
8. Command Base
9. Base AI
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.