hi in the triggers to restart video in the unity 2d course, I have written the script exactly as per the tutorial. but when the boarder crosses the finish line, it does not print anything to my console. neither does it print anything when the player’s head collides with the snow. please help
Can you share your finish line code? It would make it so much easier to help you. Also show a screenshot of the boarder with the colliders visible
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class FinishLine : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D other) {
if (other.tag == "Player")
{
Debug.Log ("collision");
}
}
}
I went on to the next video (namespace and scene management, the triggers are working fine, but i could not get anything to print
How do you know the triggers are working fine if the debug doesn’t print? It would suggest the player doesn’t have a “Player” tag
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.