Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.NavMeshAgentIntegration Class Reference
Inheritance diagram for AC.NavMeshAgentIntegration:

Public Attributes

bool useACForSpeedValues
 
float runSpeedFactor = 2f
 
bool useACForTurning = true
 
bool autoSetAvoidanceFromSpeed = false
 

Detailed Description

This script serves as a bridge between Adventure Creator and Unity's NavMeshAgent component. To use it, add it to your Player / NPC, as well as the NavMeshAgent component. You can then use the fields in the NavMeshAgent Inspector to control the character's movement.

You will also need to make sure your scene's 'Pathfinding method' is set to 'Unity Navigation'.

This script will override AC's movement code with that in the NavMeshAgent. While it is good for most purposes, it is more intended to demonstrate how such a bridge can be built. If you wish to build upon it for more custom gameplay, duplicate the script and make such changes to the copy. You can then add your new script to the character instead.

Member Data Documentation

◆ autoSetAvoidanceFromSpeed

bool AC.NavMeshAgentIntegration.autoSetAvoidanceFromSpeed = false

If True, the NavMeshAgent's avoidance priority will be set automatically based on its current speed, so that it has more priority the faster it moves

◆ runSpeedFactor

float AC.NavMeshAgentIntegration.runSpeedFactor = 2f

If useACForSpeedValues is False, the factor to apply to the character's regular speed when running

◆ useACForSpeedValues

bool AC.NavMeshAgentIntegration.useACForSpeedValues

If True, the AC character's walk and run speed values will be used to set the speed of the NavMeshAgent

◆ useACForTurning

bool AC.NavMeshAgentIntegration.useACForTurning = true

If True, the AC character's motion control field will be set to Just Turning, as opposed to Manual