Announcement

Collapse
No announcement yet.

Accessed none trying to read property

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

    Accessed none trying to read property

    Hello Unreal Forum,

    I'm new here, my name is Tom, i'm german so my english is not so good, sorry for that.
    In the little scene the ThirdPersonCharacter runs into the box and the light should go on.
    But there is an error:
    Blueprint Runtime Error: "Accessed None trying to read property Var_Door_Button". Blueprint: Door_Panel Function: Execute Ubergraph Door Panel Graph: EventGraph Node: Door Open Close"
    In the Screenshots see the details.
    Does everyone know how to solve this?
    Here is the link of this unreal project:
    https://we.tl/t-g4y0JBQwdM

    best regards
    Tom

    #2
    Hi Tom, could you share a screenshot of where you're setting the value of Var_Door_Button. The accessed none error is being displayed because it is having a null value when something is trying to access it.
    Tower Defense Starter Kit | Line of Sight Visualization | Wave Spawning System

    Comment


      #3
      Hello Stormrage256,
      thank you.
      Here is the Screenshot with the definition of "Var_Door_Button".
      How to avoid the null and how to get the variable the desired Value?

      Comment


        #4
        Alright, so what you're doing there is setting the type of the variable. So you're making sure only actors of the Door_Button type can be stored in this variable. However, since it does not specify what value it should have, it's going to give you the default value of null. And hence the Accessed None error.

        So you will have to get a reference to an instance of the Door_Button in your level & store it in the variable. Before going into that, how are you placing the Door_Button in the level? Are you placing it in the editor? Or are you spawning it during gameplay?
        Tower Defense Starter Kit | Line of Sight Visualization | Wave Spawning System

        Comment


          #5
          Hello Stormrage256,
          it's hard stuff to understand (in the tutorial all was ok. I copied it step by step but don't run).
          I made a new Blueprint - actor "Door_Button" and put a pointlight in the editor in it. Then I drag and dropped it into the scene. The same with "Door_Panel".
          I hope you have a Tip what I should do.

          Comment


            #6
            Alright, so from what I understand, you have an instance each of "Door_Button" & "Door_Panel" placed in your level from the editor. And when something overlaps the "Door_Panel" actor, you want to tell the "Door_Button" to execute an event.

            So we want the "Door_Panel" actor to have a reference to the "Door_Button" actor that you placed in the level. You're already done with the first step, which is creating a variable of type Door_Button.

            Next in the "Var_Door_Button" variable details panel (the panel on the right when you click on the variable), set the Instance Editable parameter to True. What this does is expose this variable to the editor viewport, which means when you click on the "Door_Panel" actor in the level editor, you will see this variable in the details panel.

            Click on this new exposed variable, and it will show a drop down list of all "Door_Button" actors in the level. I'm assuming that you have only one of them in your level. So just select the "Door_Button" actor shown in the drop down list and now you have a reference to it. That should be all there is to it. Now whenever you panel gets an overlap event, it can use this reference to tell the "Door_Button" what to do.
            Tower Defense Starter Kit | Line of Sight Visualization | Wave Spawning System

            Comment


              #7
              Hello Stormrage256,
              great, now it runs. I understand now the value of the variable "Var_Door_Button".
              Thank you very much.

              Comment

              Working...
              X