In this video Jesse Freeman teaches you how to enable and disable the player’s movement controller when entering and exiting battle. When the battle window is open you’ll want to make sure to not only pause the player but also disable the camera move script so that users don’t accidentally move the map while in combat.
- [Voiceover] Now let's go ahead and run our game…and test something out.…You may have noticed that when we open up…the Battle window and give focus back to the Game panel,…that we can still move the player…around in the background.…We can also right click and pan the camera around as well.…Let's go ahead and disable all player movement…and camera movement when the Battle window is open.…To do this, we're going to back…into the RandomMapTester class.…Let's create a new private method called…TogglePlayerMovement.…
Inside of it, we're going to pass a boolean…called value.…The first thing we're going to do…is get a reference to the player's…map movement controller class.…We'll do this by calling player.GetComponent…and pass in the MapMovementController class…to the method.…Next, we're going to set the enabled value…to equal the value we pass into our…TogglePlayerMovement method.…Next, let's access the main camera…and get the MoveCameraComponent on that.…
Here, we'll also set the enabled value…to the value that's supplied to the method.…
- 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?
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.