Announcement

Collapse
No announcement yet.

Accessed None trying to read property MainMenu

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

    Accessed None trying to read property MainMenu

    I have replicated the multiplayer shootout example and everything seems to be working but for some reason I keep getting this error. Any help would be greatly appreciated.

    #2
    If you're running that logic on Event Init of your game instance, try adding a small delay at the start. It's possible that the player controller has not yet been created at the time of calling the create widget node.

    Alternatively, if you have a separate player controller for your main menu, you can create the widget through its Event Begin Play, thus making sure that the player controller exists.
    Unreal Possibilities
    Wave Spawning System | Tower Defense Starter Kit | Floating Damage Texts

    Comment


      #3
      Thanks for helping out a newbie!

      I have this event being called via a function in my Game Instance from the begin playof my Main Menu level BP. Would the adding the delay still work?

      The last picture shows the beginning of the logic in my first post.
      Attached Files

      Comment


        #4
        Originally posted by BiGiRON1999 View Post
        Thanks for helping out a newbie!

        I have this event being called via a function in my Game Instance from the begin playof my Main Menu level BP. Would the adding the delay still work?

        The last picture shows the beginning of the logic in my first post.

        Yes, adding a delay (something like 0.2 should do) at the start of that Event Begin Play would do. It will at the very least let us figure out if the issue is a result of the player controller not having spawned in time.

        But if that does solve the problem, I would recommend removing the delay and having a separate player controller for your main menu, with the widget creation logic in its Event Begin Play. Delays at the start are not really good practice (unless when testing) since we don't really know if the same delay will be enough on all devices/situations. By having the widget creation logic inside the player controller, you wouldn't have to worry about how long it takes for the player controller to be spawned.
        Unreal Possibilities
        Wave Spawning System | Tower Defense Starter Kit | Floating Damage Texts

        Comment

        Working...
        X