I haven’t really discovered any good tutorials for passing variables easily between blueprints. I understand Event Dispatchers are Class to Level BP, so they’re out. I’ve tried grabbing actors like I used to UE3. My big problem was the Access to None problem, because my pawn wasn’t spawned till the game ran, so I can’t just reference the blueprint like I’ve read to do several times on here.
My problem is quite simple, and I’m hoping someone can just tell me that I forgot a step. I have a gate, a destructible actor, which has a variable of gate color. On its destruction I want to pass the color for that gate to a ball, the player’s pawn and then compare the the gate’s color with the ball’s. I’ve tried this ten to twenty different ways and kind of melting my brain at the moment for something so simple. The door tutorial doesn’t really deal with passing variables, and a lot of the other tutorials from epic are similarly vague. Hoping someone can clue me in, thanks in advance.
alt text
I’m not sure why your event isn’t firing, but you should be able to communicate with other blueprints directly.
In your first image if you drag from the OnComponentBeginOverlap Other Actor pin and type CAST into the search box of the menu that appears you should see a cast to BallActor type. From this node you should then be able to access any public variables such as its it has.
You can also put a breakpoint on the OnComponentBeginOverlap to ensure its being hit.
Thank you for the response. I’ve looked into casting in the past, I guess I’m not 100% what pins can and can’t do it. I’ve tried your suggestion in the past but I don’t get any “cast” functions from that pin you suggested, I wish there was a tutorial on what pins can and can’t cast. Thank you again.
Wow I feel dense. It would help if I looked at the right pins! I got it all working in 5 minutes after failing with interfaces and the like for what felt forever.
When I pulled from the correct pin, the actor pin, I got a whole list of Cast To’s. But at first I didn’t see my BallActor listed. I did see my GateActor however and noticed that my GateActor had an editable variable, so I tried that on a variable of my BallActor, and then it showed up, which makes sense. Unless its public then things shouldn’t be casting to it.
From there it was quite easy to pull out of my Cast To the variable I needed and then compare it. Then on a successful comparison I Cast To again to trigger a custom event. Also, after my beginOverlap I store the ball as “Ball Passing” which helps me retrieve it later.
All in all thank you, you’ve been a big help. I’m kind of embarrassed so I’m just typing out these thoughts as penitence. As a non-programmer the casting terminology was a bit lost of me, so I found this thread helpful.
I’m sure its origins are else where, but I started thinking of Cast To as similar as Casting a Net, to catch events, variables, and the like from another blueprint. Prior to success I wasn’t sure if Casting To in X blueprint to Y got me Y’s information or sent X’s information to Y.