I got this code
And its activate the collide function even though the object there is colliding aint have the tag "Goal"
Code (JavaScript):
- #pragma strict
- static var Won : boolean = false;
- function Start () {
- }
- function OnCollisionEnter2D( Collision2D )
- {
- if(gameObject.tag == "Goal")
- {
- Won = true;
- Movement.CannonPower = 1000;
- }
- }
- function Update () {
- }