Hello. we're having trouble getting our Ai pathfinding system going. We're using the A* Pathfinding Pro , and as @oak root suggested, Its great, except we cant seem to be able to make it work server side. Its worth noting that we've built our lobby system using the lobby and worlds package, which needs us to simulate physics from the game scene for some things to work. Hopefully that's relevant. The pathfinding works on the client side but never on the server. Here's the function that spawns and passes in the array of path targets.
[Server]
public void SpawnAiMinions(float _spawnDelay, NetworkConnection _conn)
{
GameObject _ai = Instantiate(_aiPrefab, _aiSpawnPoint, Quaternion.identity);
SceneLookupData sld = SceneLookupData.CreateData(gameObject.scene.handle);
UnitySceneManager.MoveGameObjectToScene(_ai, gameObject.scene);
InstanceFinder.ServerManager.Spawn(_ai, _conn);
_ai.GetComponent<MeowAI>().FindAiPath(_conn,_aiDestinations);
}```
The FindAiPath function being called looks like this.
```[TargetRpc]
public void FindAiPath(NetworkConnection _conn, Vector3[] _pos)
{
if (base.IsOwner)
_seeker.StartMultiTargetPath(transform.position, _pos, true, OnPathComplete);
}
[Client]
public void OnPathComplete(Path p)
{
if (p.error)
{
Debug.Log("path returned an error: " + p.errorLog);
return;
}
MultiTargetPath mp = p as MultiTargetPath;
if (mp == null)
return;
else
path = mp;
}
This obviously requires us to have an owner control the movement. It works. We tried the following code but cant find any nodes server side on pathcomplete. Any ideas on how to fix this ?
public void FindAiPath(Vector3[] _pos) =>_seeker.StartMultiTargetPath(transform.position, _pos, true, OnPathComplete);
@real epoch