Hi, I have a problem with BPI and custom events. Creating right now a battery which is loading after clicking a button. (For tests I’m using Event Begin Play, but after that I’ll use BeginOnOverlap due to the fact that it’s going to be for VR.
How did you reference the Other Actor in the first pic? If the variable is null, it will not work; it needs value - an existing instance of an actor that has the interface implemented. That’s why the cast fails. This has nothing to do with an interface.
but after that I’ll use BeginOnOverlap due to the fact that it’s going to be for VR.
I’d try this first - I sense the test returns a false negative.
Judging by the script above, you do not. If you do, show us how. Because creating a variable is just that - an empty variable, so to speak. You must give it value.
We do not know what is going on - you never explained. All we know is that the actor whose script we see is colliding with the VR Pawn and you’re trying to convince the editor that the VR Pawn IS the Battery - which it is not, I assume. This is what casting it - take something and attempt to treat it as something else.
I assume
And you should assume we know absolutely nothing about what you’re doing . Perhaps explain what the end goal is:
the VR pawn has a battery actor (how did they get it?)
the VR pawn collides with the charger
the VR pawn’s battery gets a notification it needs to start charging
I have 2 actors. One is a “charger” (In project for now it’s just a cube with collision box and in the future it suppose to be a button).
The other one is battery.
And of course ‘player’.
When player press the button (In this situation just walk inside the collision box), the battery should start charging (In my project for visual effect it’s just 4 plates that will change color to red)
So summary:
Player press the button, battery start charging
And those 2 actors - how do they make it into the world? Placed manually in the scene? Imagine you have 3 chargers and 3 batteries - how do we know which charger charges which battery? What is the logic behind it?
When player press the button (In this situation just walk inside the collision box)
So pressing a button is essentially the equivalent of overlapping the charger?