I am working on a project and the goal of my script is to set the first state of a gameobject inactive and then set the second state active when colliding with a gameobject with the tag “Ball.” I have made sure one or both of the trigger objects has a rigidbody and that one of them has isTrigger on and the other off. Everything I can think of does not work.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JumpPad : MonoBehaviour
{
public GameObject State1;
public GameObject State2;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Ball"))
{
State1.SetActive(false);
State2.SetActive(true);
}
}
}