NodeCanvas Forums › General Discussion › Blackboard GetVariable question
Hi,
Hoping somebody could answer this tiny question i have about getting a variable value out of the Blackboard without having to cast from Object to the type of the variable. I must be missing something obvious here.
So GetVariable<T> returns type Variable.
Im having to do this:
When i’d actually like to do this using “T Variable::GetValue<T>()” (and it seems like its possible):
But Variable is a base class of Variable<T> and doesn’t have access to the GetValue<T>() call.
Is there something i’m missing here? Sorry probably there is but cant see it!
Probably we are meant to use “Blackboard.GetValue<T>(string key)” and avoid where possible getting variables directly?
Hello,
Yes, getting the variable value from the blackboard is better done with:
🙂
There is no good reason to get the “internal” usage ‘Variable’ object unless you want to store it.
Cheers!
Join us on Discord: https://discord.gg/97q2Rjh
Ah cool, thanks!
Username
Password
Remember Me
By registering on this website you agree to our Privacy Policy.
Email
Confirm Password
Username or Email