Ln Go

BossMissile 본문

Unity/Quad Action

BossMissile

Ln Ro 2021. 6. 4. 02:20
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class BossMissile : Bullet
{
    public Transform target;
    NavMeshAgent nav;

    void Awake()
    {
        nav = GetComponent<NavMeshAgent>();
    }

    // Update is called once per frame
    void Update()
    {
        if(nav.enabled)
        {
            nav.SetDestination(target.position);
        }
    }
}

'Unity > Quad Action' 카테고리의 다른 글

Grenade  (0) 2021.06.04
Weapon  (0) 2021.06.04
BossRock  (0) 2021.06.04
Boss  (0) 2021.06.04
Enemy  (0) 2021.06.04
Comments