Resolving Ghost Issues – Understanding Nav Mesh Agents in Unity
Objectives
Resolve Ghost Movement Issues: Address and correct the problems causing the ghosts to move incorrectly or disappear in the game.
Revisit Nav Mesh Agent Settings: Examine and adjust the navigational mesh agent settings to ensure proper movement of the ghosts along the baked surface of the game environment.
Reconfigure Ghost Prefabs and Animations: Re-establish the ghost models, prefabs, and animations to ensure they function correctly in the game scene.
Script and Waypoints Setup: Implement and test scripts for the ghosts, including defining and assigning waypoints for their movement paths.
Game Testing and Debugging: Conduct thorough gameplay tests to identify and fix any issues with ghost behavior, movement, or game restarts upon player-ghost interactions.
Enhance Gaming Experience: Explore and implement additional features or optimizations for an improved gaming experience.
Steps
Revisit Nav Mesh Agent Settings:
Adjust the navigational mesh agent settings, ensuring it’s set correctly for ghost movement. This involves modifying parameters like agent radius and step height.
Reconfigure Ghost Prefab and Animator:
Create or reestablish the ghost prefab in the hierarchy.
Add and configure an Animator Controller for the ghost, ensuring it includes necessary animations like ‘Ghost Walk’.
Collider and Rigid Body Setup:
Attach a Capsule Collider and Rigid Body to the ghost prefab for collision and physics.
Observer Script and Point of View Adjustment:
Implement the Observer script from the gargoyle setup onto the ghost.
Adjust the ‘Point of View’ object’s position and rotation to align with the ghost’s dimensions.
Setup and Enable Nav Mesh Agent:
Add a Nav Mesh Agent component to the ghost, making sure it picks up the proper settings from the navigation setup.
Enable the Nav Mesh Agent for the ghost, ensuring it can use the pre-baked surface for movement.
Implement Waypoint Patrol Script:
Create a new Waypoint Patrol script, defining variable arrays for waypoints.
Assign waypoints to the ghost, starting with a single ghost for initial testing.
Test Ghost Movement and Script Functionality:
Conduct tests to ensure the ghost moves along the defined waypoints.
Continuously adjust and retest, focusing on the ghost’s interactions and pathfinding.
Duplicate Ghosts and Waypoints:
Once the initial ghost setup is successful, duplicate ghosts and waypoints as required by the game design.
Adjust the position of each ghost and its corresponding waypoints.
Final Testing and Adjustments:
Run the game to test the complete setup of dynamic observers.
Make any necessary adjustments based on testing outcomes.
Save Progress and Iterate:
Regularly save different scenes for easy reference and potential rollback.
Iterate on the setup to refine ghost behavior and interactions.
Sign In
The password must have a minimum of 8 characters of numbers and letters, contain at least 1 capital letter