[c#]collision script not working

I have a script that takes collision against walls and if i get to the goal but it does not work
I want it to let me drag and drop in the inspector to choose where my player gets teleported

using UnityEngine;
using System.Collections;

public class Collision : MonoBehaviour {
	void OnCollisionEnter2D(Collision2D coll,Transform NextSpawn) {
		if 
		(coll.gameObject.tag == "Lava")
		Application.LoadLevel (Application.loadedLevel);
		else if 
		(coll.gameObject.tag == "Victory")
				Transform.position = (NextSpawn); 
	}
}

Please do some tutorials, you are using Transform instead of transform, trying to set a Vector3 variable to a Transform variable and general readability of your code is not great. [Check these out!][1] [1]: http://unity3d.com/learn/tutorials/modules

1 Answer

1

(coll.gameObject.tag == “Victory”)
transform.position = NextSpawn.position;

NextSpawn is of type Transform, you need to do NextSpawn.position as well