Different Navigation Profile for the same Enemy
Hello!
I have a pool of Drones that I spawn at the beginning of the game using object pooling. I've set its Navigation Profile to "Drones" as you see in the image. This is used for "level1".
This is working great in level1, however when I go to level2 I'm using the same drones from my pool. They don't follow me anymore because the Navigation profile for that area is set to Level 2_1
My question is:
- Is it possible to change the drone's navigation profile on runtime?
If NOT
what are the other options?
The easiest and hackiest way I can think of is create a different asset for that drone and manually set its navigation profile and spawn those in level 2. But since there's no Unity prefab variant equivalent in Horizon world, that could be challenging since we have many navigation areas, and if we change one thing on a drone, we have to change it for all.
Thanks!
According to this https://developers.meta.com/horizon-worlds/learn/documentation/desktop-editor/npcs/nav-mesh-agents
and this https://developers.meta.com/horizon-worlds/reference/2.0.0/navmesh_navmeshagent/
I can GET the navigation profile but not set.
I can however, get and set the baseoffset
Example:
this.agent = this.entity.as(NavMeshAgent); console.log("navmesh baseoffset is:" + this.agent.baseOffset.get()); this.agent.baseOffset.set(4); this.async.setTimeout(() => { console.log("navmesh baseoffset is:" + this.agent!.baseOffset.get()); }, 2000); this.navmesh = await this.agent.getNavMesh() ?? undefined;