i want to make an enemy that when touched teleports the player to x0 y4 zn/a here is what I have:
using UnityEngine;
using System.Collections;
public class kill_player : MonoBehaviour
{
public GameObject player;
void OnCollisionEnter(Collision col)
{
if (col.gameObject.name == "murder")
{
player.transform.position = new Vector2(0, 4);
}
}
}
what makes it not work? and is it not the script?
↧