Question by
goelakshaj · Dec 02, 2021 at 03:15 PM ·
c#unity 2dtag
Changing tag in runtime
This doesn't work when my player is touching the floor
- it doesn't change the tag.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Room1Check : MonoBehaviour
{
public GameObject floor;
void Start()
{
}
void OnCollision2D(Collider2D col)
{
if (col.gameObject.name == "Player"){
floor.tag = "Activate";
}
}
}
Comment