유니티 C# 캐릭터 주변 원 운동 오브젝트 간단 구현 및 데미지 주기


유니티 C# 캐릭터 주변 원 운동 오브젝트 간단 구현 및 데미지 주기

코드 작성 using UnityEngine; public class RotatingDamageObject : MonoBehaviour { public float rotationSpeed = 10f; public float damageAmount = 10f; public float detectionRadius = 2f; private void Update() { transform.RotateAround(Vector3.zero, Vector3.up, rotationSpeed * Time.deltaTime); } private void OnTriggerEnter(Collider other) { if (other.CompareTag("Enemy")) { float distance = Vector3.Distanc..


원문링크 : 유니티 C# 캐릭터 주변 원 운동 오브젝트 간단 구현 및 데미지 주기