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

25 lines
565 B
C#
Raw Permalink Normal View History

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