Discover how to add combat action buttons to the battle window. You’ll create a button to attack the monster as well as a button to run away from battle. In addition to creating the action buttons, you’ll also add logic to randomize the look of the battle window background artwork so that it looks unique each time it opens.
- [Voiceover] Now it's time for us to finish up…our battle window.…We're going to need to add an area to store buttons…for the player to perform actions during combat.…Let's select our BattleWindow…and create a new image.…We're gonna name this Actions,…change the anchor to the bottom,…and set the position Y to 15.…Next let's go ahead and change the source image…to the window border.…And inside of this, we're gonna want to add…a vertical layout group.…
Let's go ahead and change the vertical layout's padding…to five for the left, the right, the top, and the bottom.…We'll also want to add a content size fitter.…And here we're gonna change the horizontal fit…to preferred size as well as the vertical fit…to preferred size too.…Now that our layout is set up, let's go ahead…and drag the body prefab from our advanced UI…prefab's folder onto the action's game object.…
We're gonna call this Instructions.…And inside of the text, let's write "pick an action."…We'll also want to make sure that this…is center-aligned as our action's game object…
- Preparing the user interface
- Creating game and message windows
- Building a battle window
- Adding a monster and action buttons
- Creating an actor class
- Adding player and monster attack actions
- Triggering battles from the map
- Ending a battle
- Cleaning up the battle and attack systems
- Rewarding the player
Skill Level Intermediate
1. Preparing the UI
2. Message Window
3. The Battle Window
4. Actor Classes
5. Battle Actions
6. Cleaning Up Combat
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.