OnTriggerStay()

public class base_trigger : MonoBehaviour
{
void OnTriggerStay(Collider c)
{
if ( c.transform.name == “base trigger” ) {
transform.tag =“builded”;
}
else {
transform.tag =“builder”;
}
}
}

I’m trying to change tag of a spawn grid, if there is a object builded on it but, I want it to change back to his original tag ( builder) when the object that builded o the him destroyed or deleted.

I can change the tag from builder to builded with no problem but when I delete or destroy the game object on it, I did not change its tag to the original tag.

I wonder if any of you can help me, I realy don not understand why my code is not working.

Thanks in advance…

It would be a lot easier to help you if you formatted your code correctly, but it looks like what your if statement is doing is this:

If something is in the trigger area for this object, and that object is called “base trigger”, change the tag of this object to “builded”. Otherwise, if there’s something in the trigger area for this object that’s called anything other than “base trigger”, change the tag of this object to “builder”

Is that what you meant? If you want the tag to change when the other object is moved/destroyed, you need to implement OnTriggerExit instead.