GetComponent from Collider is trigger.

I want to make an if something happens then the collider of a gameobject becomes a trigger.
i tried something along these lines: gameObject.GetComponent.Collider().true;
Which is probably extremely wrong :stuck_out_tongue:

This is the part of the script in which it has to be used:

    void OnTriggerEnter(Collider trigger)
    {
        if(trigger.gameObject.tag == "Enemy")
        {
            //and here it has to make the is trigger in the collider of the gameobject enabled.
        }
    }

I hope i gave a good explanation of my problem/question.
If you dont understand something please ask.

I can suggest such idea:

*It’s just idea, I didn’t test this code

 bool isTriggerStateAtStart;
 
 void Start()
 {
	isTriggerStateAtStart = GetComponent<Collder>().isTrigger;
 }
 
 void OnTriggerEnter(Collider trigger)
    {
        if(trigger.gameObject.tag == "Enemy")
        {
            //and here it has to make the is trigger in the collider of the gameobject enabled.
			if(trigger.isTrigger != isTriggerStateAtStart)
			{
				///become a trigger
				
				isTriggerStateAtStart = isTrigger; /// reset
			}
        }
    }

aha i can use that, i have something in mind now of how i can solve my problem.
thanks a lot :smile: