From the course: Unity 5: 2D Movement in an RPG Game

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Clean up

Clean up - Unity Tutorial

From the course: Unity 5: 2D Movement in an RPG Game

Start my 1-month free trial

Clean up

- [Voiceover] And now it's time for us to complete the last of the code we need to finish our fog of war effect. Right now, if we take a look at what we have, our fog of war effect doesn't look quite right. And that's because the fog of war tiles are still following the island a little bit too closely. One thing we can do is go into the Tile class and change the way that we calculate the ocean tiles next to a land tile when we do the fog of war. One of the ways we can fix this is change the value we set when we calculate the fog of war tile next to an ocean. Let's go into the Tile class and scroll down to our calculate fog of war auto tile ID method. As you can see, when we check to see if the tile equals no, we set the value to zero. This is what we were doing before when we calculate the regular island auto tiles. Let's go ahead and change this value to one, save it, and back in Unity, run the game. Now, each of the fog of war tiles will consider an ocean or an empty tile to be a…

Contents