Announcement

Collapse
No announcement yet.

Accessed None trying to read Property at SlotAsCanvasSlots SetPosition?

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

    Accessed None trying to read Property at SlotAsCanvasSlots SetPosition?

    Hi there..

    I´m working on some own generic Widgets, like a Slider/Progress Bar.
    It is working like a charm, wehn having a maximum count of 2 Parents above it. When getting into the 3rd Layer of Parents, i get a bunch of "Accessed None trying to read Property" Errors, based on the SlotAsCanvasSlot Function SetPosition, everytime i move the Thumb to change Values...

    Sow, here is the Code:
    Click image for larger version  Name:	Code.png Views:	1 Size:	470.3 KB ID:	1620750




    this constellation is working:
    Click image for larger version  Name:	Working.jpg Views:	1 Size:	16.4 KB ID:	1620751

    This one not:
    Click image for larger version  Name:	NotWorking.jpg Views:	1 Size:	19.8 KB ID:	1620752


    And it throws out this Error a few hundret times:
    Click image for larger version  Name:	Error.jpg Views:	1 Size:	15.1 KB ID:	1620753

    the Number at ReturnValue changes from 7,9 to 10.. don´t know what this is depending on.

    The Tick Event is for performing a Drag/Drop on Line and Sets the Position of the Thumb, depending on the mouse local-Widget position.
    I´ve no clue, why it works, when theres only 1 or 2 Parents, but not after the 3rd one...
    The Thumb and Canvas Slot is valid (cause i check them).

    The SetValue Function is called, even there are errors... But everytime i close the Testplay (STOP Game), the Message Log explodes of those Errors...

    Any ideas?
    Last edited by BDC_Patrick; 05-17-2019, 08:22 AM. Reason: Update of SetValue

    #2
    The BDCUI_SlideProgress is a child of a vertical box, not the canvas - so a canvas slot for it does not exist. Are you sure you're not doing Self->As Canvas Slot anywhere?

    edit: here maybe:

    Click image for larger version

Name:	Capture.PNG
Views:	104
Size:	94.9 KB
ID:	1620778
    Last edited by Everynone; 05-17-2019, 09:09 AM.

    Comment


      #3
      The Self->SlotAsCanvasSlot is to calculate the local Position of the Mouse inside the Widget and isn‘t part of the thumb button :/

      The error explicit says, that the cancasSlot-> SetPosition of the Thumb is the Problem. By clicking on the error, it highlights the market setPosition.

      Comment


        #4
        The Self->SlotAsCanvasSlot is to calculate the local Position of the Mouse inside the Widget and isn‘t part of the thumb button :/
        If you do Self->SlotAsCanvasSlot, you're assuming that the BDCUI_SlideProgress is a child of the canvas, which is not true. When you say:

        this constellation is working:
        that would pretty much confirm it as the widget is re-parented here. I'm not saying that I understand the setup but that's what the error you posted is saying. The Set Position is trying to access non-existent data - the canvas slot that is not there.
        Last edited by Everynone; 05-17-2019, 10:40 AM.

        Comment


          #5
          But the SetPosition sets the position of the thumb, which is set inside a canvas, which is set inside a border..

          means:
          UserWidgetSlider
          CanvasPanel
          >SizeBox
          >>CanvasPanel
          >>>Image
          >>>Image
          >>>Image
          >>>Thumb

          i‘m confused..
          i never do a self->SlotAsCanvasSlot->SetPosition

          only Thumb->SlotAsCanvasSlot-SetPosition
          Last edited by BDC_Patrick; 05-17-2019, 12:55 PM.

          Comment


            #6
            i never do a self->SlotAsCanvasSlot->SetPosition
            Thanks for confirming, can you tell what is the bit in the bottom left? The one I highlighted as it seems you're doing what I was suspecting. I might, of course, be wrong. It's kind of hard to read with all straight wires.

            It may not be about Set Position per se, just doing self->SlotAsCanvasSlot will produce errors here. Perhaps you access it in order to calculate something else, the errors will only manifest once the actual evaluation takes place - an execution input calls for it.

            But do tell if you're absolutely sure that you're not trying to access BDCUI_SlideProgress as canvas slot anywhere.
            Last edited by Everynone; 05-17-2019, 02:34 PM.

            Comment


              #7
              Seems like an issue with the ‘thumb’ variable as that is the one connected to the set position node and for which you call ‘slot as canvas slot’. Can you post the code that works to blueprintue.com along with the above code so we can more easily see the nodes and how they connect in both scenarios?

              Comment


                #8
                Posting to blueprintue here: https://blueprintue.com/blueprint/s9lta6we/
                (some Nodes seem not to be supported ^^' )

                The Bottom Left takes the mouse Position in the Viewport, takes the Widgets viewport position.. and subtracts it from the mouse position.
                This leads into a local, widget local, mouse position.

                here´s the complete code with UMG Hierarchy:
                Click image for larger version

Name:	Code.jpg
Views:	100
Size:	436.4 KB
ID:	1621379

                Comment


                  #9
                  Well, bottom left corner, as I said:

                  Click image for larger version  Name:	Untitled.jpg Views:	1 Size:	413.2 KB ID:	1621394
                  and:

                  Click image for larger version  Name:	image_164764.jpg Views:	1 Size:	19.7 KB ID:	1621395

                  Your widget is not sitting in the canvas but you're treating it as if it was.
                  Last edited by Everynone; 05-19-2019, 08:47 AM.

                  Comment


                    #10
                    i tried now to put it inside a canvas, instead of the vertical box. Same Error

                    Comment


                      #11
                      You previously said it was working while in the canvas - your first post. So what changed?

                      Comment


                        #12
                        I said, it works if there are 2 Canvases as parent..
                        Means:
                        canvas > canvas > widget

                        But:
                        canvas > canvas > canvas > widget
                        OR
                        canvas > canvas > box/button/grid..etc > widget

                        Are not working..

                        Comment


                          #13
                          Trying to help but I can only go by the images you posted and by the error message itself. If you place the BDCUI_SlideProgress directly in a canvas, do you still get the same error message?

                          Comment

                          Working...
                          X