블루 스크린 패널 3D 모델: using UnityEngine;

public class KamikazeMovement : MonoBehaviour
{
[Header("타겟  | Tripo AI
Lv.0

blue screen panel 3d model

모든 3D 모델 둘러보기
프롬프트

using UnityEngine; public class KamikazeMovement : MonoBehaviour { [Header("타겟 설정")] public Transform target; // 추적할 타겟 (예: 플레이어) [Header("이동 설정")] public float movementSpeed = 10f; // 카미카제 속도 public float turnSpeed = 5f; // 타겟으로 회전하는 속도 [Header("폭발 설정")] public float explosionDistance = 1.5f; // 타겟에서 얼마나 가까이에서 폭발해야 하는가? void Update() { // 타겟이 지정되지 않은 경우 아무 동작도 수행하지 않음 if (target == null) return; // 타겟까지의 거리 계산 float distance = Vector3.Distance(transform.position, target.position); // 폭발 거리에서 멀리 떨어져 있으면 목표물을 향해 방향을 잡고 이동합니다. if (distance > explosionDistance) { // 목표물을 향한 방향(회전) Vector3 yon = (target.position - transform.position).normalized; Quaternion targetRotation = Quaternion.LookRotation(yon); transform.rotation = Quaternion

Tripo H3.1

관련 모델