I’m doing an RTS game. Before i start game, if i place Lumber mill to the editor everything working. Worker spawn inside LM then worker going to cut trees. But if i spawn lumber mill after i started game worker moves through lumber mill walls and stuck near walls. I turned on navmesh with command “Show NAVIGATION”. Then I realized that navmesh does not detect spawned actors. In the image bottom house is spawned lumber mill.
are you attaching default controller after spawning?
“attaching default controller” means spawn default controler node ? its not working too
First of all, do you have your navmesh configured for runtime generation? The property used for that can be found in Project Settings → Navigation Mesh → Runtime Generation.
Cheers,
–mieszko
navmesh settings is default. if i enable rebuild at runtime then anything does not work. every mesh have big navmesh holes around and worker just spawn and stand still
Would you mind posting an image to help me understand? Regardless, this would mean you have to adjust navigation properties of your actors. Every primitive component has a CanEverAffectNavigation
flag that when set to false will result in navigation system totally ignoring it. Collision channels used also matter - everything marked as blocking pawns or vehicles by default affects navmesh generation.
with CanEverAffectNavigation flag everything working now its just solve my problem
but i have another question destructible mesh does not affect on navmesh right ? im using destructible mesh and blocking walls in blueprint with basic shapes for nav mesh roads. but this shapes have big holes in mavmesh is there a way to reduce size of this holes ? or im doing it wrong?
Size of the “holes” is based on navigation agent radius. Remember that agent’s radius is pre-backed into the navmesh, so that at runtime we’re moving points on the navmesh, not circles (a lot faster!).
Thank you MieszkoZ!!