I have two colliders:
A mesh collider, which is just a normal collider, and a trigger collider to detect when the player is near the object and run some code. I’m using OnTriggerEnter and OnTriggerExit, but the only things in them are Debug.Logs.
My player has a rigidbody component, my object does not.
My player hits the trigger collider as if it’s a solid normal collider and I can’t figure out why…
I’ve solved it by creating a new empty with a trigger parented to the object I wanted the trigger on.
I think it was simply that the object with the trigger also had a normal mesh collider which messed with things, but I’ve fixed it just by making a new empty with only a trigger collider.
If you have a similar problem, try that! Here’s some sample code for linking up the empty with the collider and the object you wanted the collider code on:
public GameObject yourObject;
private void OnTriggerEnter(){
[Your Code Here]
//make yourObject jump using rigidbody physics
yourObject.GetComponent<Rigidbody>().AddForce(transform.up)
}