Announcement

Collapse
No announcement yet.

isValid returns Both True and False, in the same frame

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

    isValid returns Both True and False, in the same frame

    Howdy, I'm a newcomer to UE4, and I have encountered a very strange bug that I can't seem to solve.

    When I run this isValid on the actor 'EndObjectLocation' (This is set as a variable to a different BP, and is set in the editor as the reference.) the BP outputs but true and false in the same frame, which I didn't think one function could have two separate returns. So I'm confused and would like some assistance.

    #2
    So tick fires every frame. Delay will delay execution. If you call delay again while it is counting down, that call will be ignored.

    Cant see where "End Object Location" is set or what its lifetime is.... in general when the delay finally fires the state of End Object Location seems indeterminate.

    Calling delay off of tick is not a good practice in general
    https://www.casualdistractiongames.com

    Comment


      #3
      Even if I take away the delay, the problem still exists.

      "End Object Location" actor is a public variable, referencing another object in the scene.

      Comment


        #4
        You can add breakpoints in bp. Put a breakpoint on is valid and on each print. On subsequent ticks End Object Location is probably becoming valid/invalid.

        Why do you think it is occuring in the same frame?

        Replace the delay in your original picture with a Print "Tick".

        Then Tick should separate True and False

        Also check to make sure you dont have multiple objects of this bp class in the scene

        When in the bp breakpoint, use the dropdown to smake sure you can only select one object for debugging
        https://www.casualdistractiongames.com

        Comment


          #5
          You might have accidentally placed 2 instances of this BP, and only one has the target assigned?

          Comment


            #6
            Originally posted by Zeblote View Post
            You might have accidentally placed 2 instances of this BP, and only one has the target assigned?
            There is only one in my scene, but that was a great piece of advice and I'm trying to triple check that it's not hiding somewhere. Because this feels like the logical answer...

            Originally posted by OptimisticMonkey View Post
            You can add breakpoints in bp. Put a breakpoint on is valid and on each print. On subsequent ticks End Object Location is probably becoming valid/invalid.

            Why do you think it is occuring in the same frame?

            Replace the delay in your original picture with a Print "Tick".

            Then Tick should separate True and False

            Also check to make sure you dont have multiple objects of this bp class in the scene

            When in the bp breakpoint, use the drop-down to make sure you can only select one object for debugging
            I believe it's the same frame because when I ran it with the tick suggestion, every time I ran the breakpoint and clicked step over. It would print out tick, true, tick, false.
            Is there a better way to run the BP debugging? I don't know what dropdown you are talking about to select only one object.

            Thank you both again

            Comment


              #7
              *sigh* there were 2 instances of that BP. One was just being generated at run time of a different object. Thank you for your aid,

              have a good day.

              Comment

              Working...
              X