GeoJam2021/Assets/Scripts/Death.cs
2021-07-20 21:40:21 +02:00

19 lines
445 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Death : MonoBehaviour
{
void Start() {
}
private void OnCollisionEnter2D (Collision2D collisionInfo)
{
if (collisionInfo.collider.name == "Player") {
collisionInfo.collider.transform.position = Vector3.zero;
collisionInfo.collider.GetComponent<Rigidbody2D>().velocity = Vector3.zero;
}
}
}