Hi! I'm having trouble getting OnColliderEnter to trigger when I want it to, and I can't tell why! Here is the code:
void OnCollisionEnter(Collision collision)
{
Debug.Log("ANT COLLISION: " + ToString() + " collides with a " + collision.gameObject.name);
Location location;
LocationType locationType = LocationType.None;
if (collision.gameObject.TryGetComponent(out location))
{
locationType = location.LocationType;
}
_pheromoneMachine.CurrentPheromone.OnCollision(collision.gameObject);
if (locationType == LocationType.Colony)
{
Colony.Memory.UpdateColonyMemory(Memory);
Memory.UpdateAntMemory(Colony.Memory);
Debug.Log("ANT MEMORY: " + ToString() + " updates Colony and own memory: ");
if (Caste.HasNewSequence(_timeOfLastPheromoneChange))
{
_pheromoneMachine.SetPheromoneSequence(Caste.PheromoneSequence);
_timeOfLastPheromoneChange = Time.time;
}
}
}