Local Node Variable Not Visible inside inspector

I have a bug where in an action node, a BlackBoardVariable is not visible in the inspector of the behavior graph node. Neither can I add a layer mask as a variable in the blackboard. Is it not possible to have layermask as a variable? Also, what is the way to have variables visible in the graph inspector without marking them as blackboard variables? I have a lot of variables that work locally within the node and don’t need to be a blackboard variable;

Hi,

a BlackBoardVariable is not visible in the inspector of the behavior graph node

Could we have more detail on this please? Is it a custom action node or one of ours? If it’s your own node it would help if you could paste the script.

Neither can I add a layer mask as a variable in the blackboard

Indeed this doesn’t look supported. I’ll add a task to our backlog.

what is the way to have variables visible in the graph inspector without marking them as blackboard variables

I would view the BlackboardVariable<> as the default approach and make all variables that way. You can simply not link them up to anything in the blackboards to use them as a normal variable.

Hope that helps,

Thanks

Hey @purnabratarobo, I’m just going to touch on this one as David responded to the rest. This is a task on my list to allow so you can have something like the following show on the node inspector.

public float MyFloat = 5.0f;

This should hopefully be available in Q1. I hope this helps! :slight_smile:

yes I wanted to know how i can have public float MyFloat=5.0f; show up of the node inspector. Glad that it is in the works. Sorry I’m not sure what Q1 is or how I can check about it, could you also please let me know where I can find more about it?

here is the code and the graph inspector view, the blackboardvariable LM does not appear in the inspector.

Hey @purnabratarobo , Q1 is just a short way to say first quarter, so Jan-March of 2025. We don’t have a public roadmap yet but I’m hopeful I can tackle it for early 2025 :slight_smile:

Unfortunately we do not support Layermask at this time :frowning: We’ll look into adding support for it, but I doubt it’ll happen in December, so probably Q1.

Please note your BlackboardVariables need to have the [SerializeReference] tags to work properly.

On another note, maybe this action should be broken down a little? It looks like you’re handling detection, UI and various other things in one action, making it sort of a super action. Would you like to walk me through what you’re doing here a bit and see if it can be broken down into multiple actions, or a subgraph?

Also I see you have Player, Self and Agent. What’s the difference between Self and Agent here?

Yes I was using the serialized field, just was trying out different things in hopes to have it show up. Must have forgotten to add it back. So even having a Layermask as a public variable even just in the node is not available at the moment?

Yep, unfortunately LayerMask and structs in general aren’t supported as BlackboardVariables at this time. I’m hoping to add support early 2025.

Please note, it needs to be [SerializeReference], not [SerializeField], I’m just pointing it out because making this mistake can lead to losing time and frustration due to a simple mistake :slight_smile:

2 Likes

self is the enemy gameobject, agent is the navmesh agent on the script. the node searches for the player using raycasts and when it hits, it runs a timer that when complete and player is still in sigh of raycastt, it returns success. the UI is part of the timer. the Part I am stuck on is making the raycast use a layer mask to ignore selective layers to search the player. since I cant see the layermask as a variable in the inspector.

I understand. That’s not great, I’m sorry :confused: For now, can you use a workaround? For example:

  1. Create a MonoBehaviour or a ScriptableObject, let’s call it DetectionSensor.
  2. Have the LayerMask on the DetectionSensor. Optionally, you can move other things to it if it makes things easier to reference once on the MonoBehavior.
  3. Instead of passing the Self as a GameObject, pass the DetectionSensor, then you can access the LayerMask from there, and the gameObject.

P.S. Did you know you can use .GameObject inside your node (Action/Modifier/etc)? It will be the GameObject that is running the graph (the one with the BehaviorGraphAgent component) :slight_smile:

I hope this helps!

1 Like