Hey everyone, I’m fairly new with Unity and have been following several tutorials to try to get a good handle on the program. I’m loving it so far, but one huge problem that I keep encountering is that try as I might, I can NEVER get 2D triggers to work when using colliders.
Basically, I’m creating a background looper so that my background can scroll, and to do so I’ve put 2D box colliders on all of my background objects. I’ve set them all to be triggers, and furthermore I’ve put them all on a “Background” layer which I’ve only allowed to collide with other background layers. Then, I made an empty game object which I put on the same layer, added a 2D Box collider (Which is also a trigger) as well as rigidbody 2D. I know the kinematic thing prevents triggers or collisions from happening so instead I just made it unaffected by gravity, and finally I added this code to it:
using UnityEngine;
using System.Collections;
public class BGLooperScript : MonoBehaviour {
void onTriggerEnter2D(Collider2D collider) {
Debug.Log ("Triggered: " + collider.name);
}
}
When I go to test the game however, nothing shows up in my console and no collisions occur.
Any help would be fantastic, and a fair warning ahead of time is that I really don’t know a whole lot about coding.
Thank you!