Question by
Bodopod · Dec 01, 2019 at 08:32 PM ·
playertriggersdetectionif statement
How do I detect if the player specifically is interacting with a trigger?
My code is
using UnityEngine;
public class EndTrigger : MonoBehaviour
{
public GameManager gameManager;
void OnTriggerEnter () {
gameManager.CompleteLevel();
}
}
I want to make the OnTiggerEnter's code to only run if the player runs into it. I'll respond with the game manager's code if necessary.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612215541im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to detect player collision in an object 0 Answers
Make certain things happen at certain points. 1 Answer
Find Objects in Trigger and Effect Player 1 Answer
Enemies cannot kill Player. 0 Answers