Setting a Boolean in one Blueprint from another blueprint

Hello,

I currently have a Pawn blueprint which contains a ‘Damage’ variable, I want to be able to set that variable whenever the Pawn collides with certain other blueprints. (Fire, Water, etc).

I’ve read a few tutorials to do with Blueprints and Interfaces but just can’t seem to get it to work.

Any ideas?

You have two options you could use.

  1. You could make that variable public and allow the modification of it from anywhere.
  2. You could create a function which is doing that. (I would suggest this).

Now on the events “event on begin overlap” or “event hit” you get the actor which is colliding. Cast that one to your character pawn (Just go in the context menu and search for “cast to”) and then use the result of that to call that function or get/set that variable.

Will this get you started?

Whether it be in the level blueprint or a class BP of the fire or water, just type get player character, drag a wire and type cast…cast to your player BP. Drag a wire from the blue output and type the bool variable in the player BP you want to turn on. Set it. Turn it on. Tada. :wink:

Thanks! Works perfectly, I presumed it would be something complicated, I presumed wrong! :stuck_out_tongue:

Works for me as well. Thanks