So i currently try to do a maze game. I want to place a button at one location which opens a gate in another location. I thought of making 2 blueprints, one for the button and the other for the gate itself. I just can not figure out what I did wrong… I always get this strange Error : Blueprint Runtime Error: “Accessed None trying to read property Gate”. Node: Opening Gate Graph: EventGraph Function: Execute Ubergraph BP Gate Button Blueprint: BP_GateButton
It’s the most common error.
Which gate? The editor does not know which one you mean. What if there are 10 gates? Creating a reference variable does not do anything on its own. You need to assign it a value - an existing instance of a Gate
actor.
- flag this gate variable as
Instance Editable
- select the button actor in the world, look at its details panel - you will see an exposed variable to assign a value to:
- choose a gate this button actor should reference
I thought of making 2 blueprints, one for the button and the other for the gate itself.
Ideally, you’d put both in the same blueprints. This way you wouldn’t need to do the above. You have all of it in one place.
Also, consider posting in Programming & Scripting next time. International is somewhat deserted.
Thank you! But I thought that if i would do it in one blueprint it would be a mess to place both on different locations. But I am a very beginner and don’t know a lot about this all. Thanks for this detailed answer!!!
Here’s how it’s normally done:
- the button and the gate are in the same blueprint
- the
press E to do something
should be in the player BP or in the Player Controller
Input on actors is disabled by default. Enabling it is often not a great idea:
Unless you have a very specific scenario, and this is not it. It would / could work when the game is small and simple. But as soon as you scale things up, it will become difficult to control.
Here’s a couple of related tuts if you want to look deeper into how interactions can be done:
Good luck!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.