hi to evryone, actually i’m having my first experience with ar fundation actually i’m trying to disable a mesh renderer when the game object collide with something with tag “portal” but actually when my object collide with it nothing happens
this is my object with tag “portal”
and this is the object which has the meshrenderer that i want to disable
also this is the code that i’m trying to use
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(MeshRenderer))]
public class portaltrigger : MonoBehaviour
{
MeshRenderer mymeshrenderer;
// Start is called before the first frame update
void Start()
{
mymeshrenderer = GetComponent<MeshRenderer>();
}
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("portal"))
{
mymeshrenderer.enabled = false;
Debug.Log("vedi tutto");
}
}
}
as you can see i’m trying to check the collision with a log but neither the log compare in the console if 2 portals collide

