This week, I arranged the stone wall surrounding the level that prevents the player from falling off the level. One thing I noticed is that the pieces of the wall were apart, and despite the box collider, gaps were visible, and the player was able to see far out, which could have given the player the impression that falling off the forest was possible. To fix this problem, I gathered all the "destroyed wall" assets that made up the walls surrounding the level and moved them closer to one another to close off the seeable gaps. Problems I encountered include Z-fighting, as well as having to duplicate/size some of the separate assets. It was also tough to see the walls, so I had to make the trees, environment, platform, terrain, and UI all invisible for the walls to be easier to see. In addition, I tried to make the wall as "smooth" as possible such that it doesn't look so rough from the top-down view in scene mode.
I also created the health Pickup script which will earn the player health when they collect a first aid kit. The health Kit is a model entitled "First-Aid Set" from the Asset Store. I chose the red kit because I felt like red would be the most suitable color for healing. I scaled the health pack down to the size of a collectable object in a game and put it in the scene so the player could reach it, in my case, I put it before the first gate. I checked the Is Trigger box on the Box Collider component for the health pickup prefab. In the Health Pickup script, which I placed onto the Health Kit prefab, I coded the script so that the health kit will only make impact when touched by the player (Tagged "Player"). I added the public float GainedHealth which will say how much health the player will receive when collecting the health pack, as well as a Destroy(gameObject) function so that the health pack disappears when the player collects it. In my case, on the inspector window, I had set the Gained Health to "100", but, although the code works, when I collect the kit, I receive 200 health (so double the amount I wanted).
Comments