cnam-geometry-dash/Assets/Scripts/ObstacleKiller.cs

25 lines
568 B
C#
Raw Normal View History

using UnityEngine;
2024-12-16 16:53:55 +01:00
public class ObstacleKiller : MonoBehaviour
{
2024-12-16 16:19:59 +01:00
public PlayerScript playerScript;
public GameObject playerObject;
2024-12-16 16:19:59 +01:00
public void Start()
{
playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerScript>();
}
2024-12-16 16:19:59 +01:00
public void Update()
{
}
public void OnTriggerEnter2D(Collider2D collision)
{
2024-12-16 16:19:59 +01:00
playerObject.transform.rotation = playerScript.initialRotation;
playerObject.transform.position = playerScript.initialPosition;
2024-12-16 16:53:55 +01:00
playerScript.isColliding = false;
}
}