Infinite Runner Tutorial - Destroyers not Colliding
Hi guys, I'm just trying Mike Geig's tutorial and I can't see whats wrong with my destroyer script.
using UnityEngine;
using System.Collections;
public class DestroyerScript : MonoBehaviour {
[SerializeField] Rigidbody2D player;
void onTriggerEnter2D(Collider2D other)
{
Debug.Log("triggered");
if (other.tag == "Player")
{
Debug.Break();
return;
}
if (other.gameObject.transform.parent)
{
Destroy(other.gameObject.transform.parent.gameObject);
}
else
{
Destroy(other.gameObject);
}
}
}
I tried adding a Field to drag the player to the script in the hopes that maybe something would change, but I'm pretty sure it does nothing since the onTriggerEnter2D is just looking for other colliders. And yes, the CharacterRobotBoy is tagged as "Player".
My character just runs off the platform, and drops right through the quad without anything happening. I'm sure I'm missing something super simple, cause I'm just starting out with Unity, so any info and tips are appreciated.
I did check the other answers.unity3d question that was posted but couldn't find my solution there. Thanks for reading.
unity-2016-08-13-23-02-23.png
(58.2 kB)
Comment