So I have a 2 Agents. Agent 1 is shooting at agent 2. The bullet is a trigger and the agent has a collider. I have a bulletController script and a AgentController.
My problem:
If one agent hits the other with a bullet I get NullReferenceException, because in the agents script I have a OnTriggerEnter and I look there if the bullet hits. But the agent doesn’t have a trigger. So would it work if I set the method to onCollisionEnter, even if the bullet is a trigger? How can I solve this? But I do not want to place the Ontriggerenter to the bullet script.