U
U
Uncle Bogdan2021-04-10 16:39:32
C++ / C#
Uncle Bogdan, 2021-04-10 16:39:32

Why is "Enemy" with NavMesh not visible when I turn on the game test?

Without NavMesh everything works, without it the enemy is not visible.
The layer is not affected.
By z, the position is -0.3099992 (setting it manually does not help).
The code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class Enemy : MonoBehaviour
{
    [SerializeField] Transform Target;

    [SerializeField] NavMeshAgent AI;

    // Update is called once per frame
    void Update()
    {
        AI.SetDestination(Target.position);
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question