collision doesn't works

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

Hi

“why collision doesn’t works” - 10 - 5 ?

What do you mean with your poll… ?

Also, does this question have something to do with Unity script and Visual Studio, or did you add those tags for no reason? Some people search questions based on tags…

Anyway - have you actually watched any basics tutorials…?

Both of your objects must have colliders and one must also have another component which is missing now. Otherwise collision detection won’t work.