(Devlog 4) Interactive Environment Assets
Interactive Environment
Paranormal Pursuits emphasis on the players immersive experience is crucial to the games success. Introducing different assets into the game that the player can interactive with provides the game with a certain level of volume that creates a polished feel while navigating through the characters journey.
Locations to hide
A closet function has been added to the game so when the Ghost is hunting the player, the player has the opportunity to hide from the Ghost inside one of multiple closets set up around the map. The function is important, as it gives the player a chance to survive each hunt.
Closet
The closet is comprised of two scrips attached to the object, the first script being the 'ToggleController' script , this script is set up using collider detection to detect if the player is touching the object, and based on the that variable it gives the player an option of toggling on and off its visibility. The function of toggling off and on the players visibility imitates the player walking into the closet and hiding from the Ghost.
The second script is the 'ClosetZoom' script, this script is responsible for switching virtual cameras based the same keys used to toggle its visibility. When the player clicks the keys to enter and exit the close, the main camera is switched to a specific camera responsible for zooming into the closet. This small zooming feature provides a polished feel to the game, it clearly displays to the player when the character has entered and exited the closet.
Challenges
The biggest challenge I faced was setting up multiple closets, the way the script was initially set up did not work for when I duplicated the closet object. After a lot of playing around with it I managed to set it up correctly, however I was not able to set it up too use one key to toggle the players visibility, it has to use a separate key for toggling the players visibility off and on.
The second challenge I faced was making the players camera zoom into the correct closet. Since there is multiple closets set up around the map, based on which closet the player decides to enter the camera has to zoom into that closet, which took me a while to set up as initially I had the 'ClosetZoom' script set up on the Player game object. This was a problem because when it was set up on the Player the script would not recognize which closet the Player was trying to enter and it would zoom into only one of the closets. By adding the script to each closet I was able to make each closet independent of each other and have separate virtual camera set up to follow each closet.
Edit #1 - After backing up my project I notice that the zoom function would not work like it did. After a lot of trial and error I figured out why, the 'ClosetZoom' and 'ToggleController' scripts were attach to the same closet object, the zoom function would simply not work. Because both script use the same keys to toggle on and off their behavior, unity craps it self essentially and does not run the 'ClosetZoom' script.
Using my sheer brain power and supreme intelligence I managed to think of a solution which would baffle many. I added an empty game object with a separate duplicated collider to the closet object (empty game object is a child of the closet object), I then attached the 'ClosetZoom' script to this new collider.
Edit #2 - Upon opening the project again I noticed that the fix does not work. However, I managed to properly fix it. I deleted the empty game object with the second collider and combine the 'ClosetZoom' and 'ToggleController' into one big script. For some reason when adding both scripts together, it works perfectly fine, even after closing and reopening the project.
Paranormal Pursuit (Beta v0.3)
2D Top Down Horror Game
More posts
- Game Testing SessionMay 31, 2024
- (Devlog 9) Open Beta ReleaseMay 16, 2024
- (Devlog 7) Core Mechanic and UI UpdateMay 06, 2024
- (Devlog 8) Player Animation and Headlamp OverhaulMay 06, 2024
- (Devlog 5) Ghost Prefabs and SpawnerApr 30, 2024
- (Devlog 6) Lighting and Post ProcessingApr 30, 2024
- (Devlog 3) User Interface and ScenesApr 25, 2024
- (Devlog 2) Background GraphicsApr 24, 2024
- (Devlog 1) Player MovementApr 24, 2024
Leave a comment
Log in with itch.io to leave a comment.