Hi!
I’m making a scene to train a ML-Agent. It’s this 9 isolated isles:
Each isle is a copy of a prefab I made with terrain, navmesh and 2 agents: a deer and a hunter.
The hunter from the original isle (the one I dragged to create the prefab) is correctly chasing the deer. The problem is: hunters from the cloned isles are trying to chase the deer from the original isle, walking towards their respective isles edges.
I’m using a serialize field to determine each hunter goal, and each of these fields are correctly assigned with the deer from its own isle. This is my simple script for the hunters:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class Chegar : MonoBehaviour
{
[SerializeField] private Transform goalTransform;
NavMeshAgent agent;
void Start()
{
agent = GetComponent <NavMeshAgent>();
}
void Update()
{
agent.SetDestination(goalTransform.localPosition);
}
}
Thanks in advance!