I’m trying to create a navmesh volume from blueprint.
So far i tried to spawn the volume with SpawnActor, but i should be missing some points as i can’t figure it out how to make that work (i tried with BSP for testing purpose : it does not work either).
The shape of a Volume is define by BSP brushes, and these cannot be spawned at runtime. So even if you successfully spawn a NavMeshBoundsVolume actor it won’t be fully functional.
What are you trying to do? Is spawning volumes is the only way to achieve what you want?
Hi mieszko, thank you for the answer
What I try to achieve is to have a navmesh added on the map at specified location. The map is too big to cover it all from the editor.
Instead of spawning the volume would it be possible to copy a previously made volume for exemple ? I only succeed so far to move a volume not “duplicate” it.
I have something in the works that will give you functionality you need (should be ready for 4.8). For now I suggest using a workaround, like having a pool of pre-created Volumes you move and scale at runtime.
, would you mind elaborating on how exactly to scale a ANavMeshBoundsVolume instance in C++? I’m a bit confused on how one would do so at runtime with all the brush builder stuff - if that’s even relevant.
The trick I’ve used in one project was to have a unit-sized NavMeshBoundsVolume (1x1x1uu) and scale it at runtime like so:
// hack-change modify frequency - otherwise SetActorLocation will fail.
NavmeshBounds->GetRootComponent()->SetMobility(EComponentMobility::Stationary);
NavmeshBounds->SetActorLocation(MyBounds.GetCenter(), false);
NavmeshBounds->SetActorRelativeScale3D(MyBounds.GetSize());
NavmeshBounds->GetRootComponent()->UpdateBounds();
// redo modify frequency change
NavmeshBounds->GetRootComponent()->SetMobility(EComponentMobility::Static);
where MyBounds is an arbitrary FBox. This works in cooked builds as well. You might need to call UNavigationSystem::OnNavigationBoundsUpdated after such nav bounds scaling.
Navigation Invokers is what I had in mind, and that’s indeed up and running in 4.8. There’s unfortunately no documentation on it, but have a look at a (very rough) video I’ve recorded for it: https://drive.google.com/open?id=0Bwm0SVD0Nb8HdUExVUE1NmkzN2c
Thanks for sharing that video MieszkoZ ! I’m going to test out your system in a game i’m trying to develop. Because my entire level is being generated via blueprints (like the endless runner tutorial), i can put a huge navmesh bounds box and then generate the nav mesh as i go!
Not sure if it’ll work, but without your work, i would’ve had no place to start! TY TY TY!!!
This is exactly what I’ve been looking for, this is literally the only source i found for how to set this up. <3 Am i allowed to post this in the UE4 community knowledge base? If the traffic is too much I can upload to youtube with references back to this post.