Download

Am I using ?IsValid correctly?

After converting my project to 4.9 a couple of my blueprints give me me "Accessed None ‘Primitive Component’ errors.
But, the component works just fine.

In trying to figure out the problem, I thought IsValid would tell me if the component was valid or not.
All it does is make the blueprint stop giving me errors.

So I guess I am a bit confused. Is the purpose of IsValid to tell me if the component is valid, or am I telling the blueprint, hey… this thing is valid… please proceed.

your using it right

its just performing a check that pretty much just makes sure that whatever you have plugged into it actually exists before executing. its actually good to run these checks on important things.

if this was c++ its the equivalent of:


void YourStuff::Tick(float DeltaSeconds)
{

       **if(World)** // make sure world **is valid**
        {
            Execute::Code
        }

}

or atleast i think it is im still learning

What is likely happening is that code is being run before that component is ready. All isValid is doing there is making sure that code can’t run until that component is ready.