I want to have a sign in my scene and I have it set to a box collider with Is Trigger as true, but I have no idea how to access the OnCollisionStay2d for C# in Monodevelop. The idea is that I have a canvas with text on it, and I want to set the opacity to 255 when the player is inside the collider, I won't LERP it, because that's unnecessary. I'd appreciate some help. Thanks guys! Also, I've checked the Documentation, but it's not really that helpful. I'm not experienced. Heck I'm 13.
make tag for player Player. Then c# script for sign void OnTriggerStay2D (Collider2D other) { if (other.gameObject.tag == "Player") //here something what you want ;}
Thanks! That's really helpful. But now, I've got the error which I can't use void in front of OnTriggerStay2d: I get this error: Assets/Scripts/Visiblity.cs(9,20): error CS1519: Unexpected symbol `void' in class, struct, or interface member declaration I'm not really sure about how to fix this. "Return OnTriggerStay2D" or anything. I can't figure out these return types. Help please!