Announcement

Collapse
No announcement yet.

Am I using ?IsValid correctly?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Attached Files

    #2
    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:

    Code:
    void YourStuff::Tick(float DeltaSeconds)
    {
    
           if(World) // make sure world is valid
            {
                Execute::Code
            }
    
    }
    or atleast i think it is im still learning
    Self-Learning to program, Open to advice!

    Comment


      #3
      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.
      They broke the signatures so I removed mine thinking it'd be awhile. The signatures work again, but I haven't redone my signature yet.

      Comment

      Working...
      X