How can I get navmesh data into my class blueprint?

right now I’m trying to set up a function in my level blueprint that can be queried by one of my class blueprints. It queries navmesh and returns a valid destination (this will eventually be more complex)

then in my class blueprint I have a variable which is set to level blueprint. I am dragging off this and it does give me my function, but I get a weird error at runtime that says - Error Accessed None ‘TargetLevelBlueprint’ from node Construction Script in blueprint ATAT_BP

Hey SirYakalo,

It shouldn’t be possible to reference Level Blueprint from another BP. I’m not sure why you’re able to use Example_Map_C reference as a variable in another Class BP, and I’ll be checking with developers to see why that is.

To get a reference to Nav Mesh inside a Class BP, you can use Get All Actors Of Class node and use a ForEachLoop to get its specific reference:

Hope that helps! I’ll let you know what I find out about that Example_Map_C object type variable.

2 Likes

thanks! out of onterest should nav data be connected to world context input of random point node is that a typo - so to speak.

Nav Data input is looking for NavigationData object type, but we’re feeding node your RecastNavMesh object in level. If you were to drag off Array Element returned in ForEachLoop, you could cast to its NavigationData and then plug that into Nav Data input node. World Context accepts RecastNavMesh in level, so you won’t have to cast to Navigation Data explicitly.

It does seem like that could be labeled better, and I will bring that up to developers. Thanks!