Hi guys, I’m trying to make my character collide with a gameObject (Plane) with OnTriggerEnter or OnCollisionEnter, but in none of the cases it worked. The script to detect the collision is in the plane, and in the character the isTrigger option is enabled. Both have Rigidibody and Collider. The script and images are below. I really appreciate any help!
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OutdoorCollision : MonoBehaviour
{
void OnTriggerEnter(Collider col)
{
Debug.Log(“hit!”);
if (col.gameObject.tag == “Player”)
{
Debug.Log(“hit!”);
print(“hit!”);
}
}
void OnCollisionEnter(Collision col)
{
Debug.Log("hit!");
if (col.gameObject.tag == "Player")
{
Debug.Log("hit!");
print("hit!");
}
}
}
`