Posted January 17, 2022 by Ghazal Jain
The first step was to create prefabs for the various terrains: Ice, Water, Glass, Grass and Sand. The next step consisted of creating the player with a collider for detection and character controller for movement. After scripting the movements, Scriptable Objects were used to play the desired sound effects for the specific terrain type. With the help of Unity’s GUI library, the logs were displayed for the character and terrain stats.
The player has a capsule collider attached which triggers whenever the player leaves a specific terrain type area and enters a new one. For instance, if the player leaves the sand terrain and enters the glass terrain, the speed of the player is decreased as well as the glass scriptable object is used for the sfx for the glass footsteps. Prototyping the build was a fun experience! Adding sfx made it interesting.