I have a problem to do explotion of objects around the navAgent, I want that when the agent stops they do a explosión and move all the objects around him, the problem is that when the objects enter into the trigger nothing happens, but when I throw the objects the trigger on.
There’s a better form to do that???
Thanks and sorry for my bad english.
I am not sure that I fully understand what you are asking for, but from what I can understand, you have a Navmesh Agent that traverses some path and eventually comes to his destination. When he stops you want to have it explode and push the objects around it. If this is the case, you can check if the NavMeshAgent has stopped by checking if it’s velocity (Unity - Scripting API: AI.NavMeshAgent.velocity)
is or is close to zero.
If the Agent is stopped, you could enable an invisible sphere attached to that agent that is a trigger. You then attach a script to that invisible trigger and create an OnTriggerEnter function inside of it. In the function, check if the Collision object has a Rigidbody, and if it does, call Rigidbody.Addforce()(Unity - Scripting API: Rigidbody.AddForce)