1
0
Files
LupiNexMedia f84f5c592b initial commit
2026-04-28 09:32:03 +02:00

34 lines
778 B
C#

using System.Security.Cryptography;
using UnityEngine;
public class Collectible : MonoBehaviour
{
public float rotationSpeed;
public GameObject onCollectEffect;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Rotate(0, rotationSpeed, 0);
}
private void OnTriggerEnter(Collider other)
{
// Check on Player
if (other.CompareTag("Player"))
{
// Destroy the collectible
Destroy(gameObject);
// instantiate the particle effect
Instantiate(onCollectEffect, transform.position, transform.rotation);
}
}
}