In Check Trigger 2D action, I store the GameObject of a bullet that hit a character so in next state it can face the bullet. I’m using Dynamic Variable as it’s a temporary thing but I can’t find how to retrieve info from it in the next state for the life of me!
To clarify, I need to access my Dynamic Variable from a Check Trigger 2D in the next state I’m transitioning to via my own custom Actions.
p.s. I have a lot of problem accessing the website today, almost always it fails to load.
Apparently I can do it via blackboard.GetVariable<T>("myDynamicVariableName") , wish there was an example in the documentation about it. Please correct me if I’m wrong in terms of either this is a good use case for using Dynamic Varibles and/or how to access it.
When that line of code is executed, NC says it promoted the Dynamic Variable to a Variable in Blackboard, why is it?
I can’t still access that variable, I tried the following: blackboard.GetVariable<GameObject>("_LastBulletThatHitMe").value blackboard.GetVariable<GameObject>("_LastBulletThatHitMe")
but it’s always null.
Sorry for spamming, I’ve been trying to do this by myself for past few days and I ran out of time.
I am sorry that I wasn’t able to reply sooner that you’ve found the cause, but I am glad that you’ve found the cause after all 🙂
If you have any other questions or problems, please let me know.
I think the most important missing piece from your documentation is code examples. I assume[d] your main audience are coders but your docs are mainly demonstrate using the editor and since I’m mostly trying to incorporate NC into my game via code (making tasks/actions), I usually find what I want in the docs but it does not provide code examples as well. Like dynamic variables and more recently global blackboards. I got global blackboards to work but I’m not sure if it’s the right way to do it (since I see a lot of template code behind the scene and it scares me a bit as I have to release soon and don’t have time to test much).
I’m hoping to provide these helps for the docs (via google doc’s commenting I think is best) but I have to learn them myself first.
While there are some documentation sections that explain how to make custom tasks or use blackboard variables through code for example, can you pleae let me know what kind of coding examples you would like to see in the docs on top of those?