Download

boolean in one BP from another BP problem

hello there

Sorry for being a noob with the engine. I am currently trying to set up a Boolean. I am trying to use a Key to set a Boolean true or false but it only works when i place it in MyController BP. The problem i am having is i can’t get the boolean variable in another BP.

this is what i have in MyCharacter

InputAction Inventory
Pressed connected to a flipflop A is set boolean true. B is set Boolean false.

i am trying to use this boolean variable is another BP to make a branch condition true or false.

i would put this in the same BP as the branch but the InputAction doesn’t work there.

If i click the Eye on the Boolean and uncheck the context sensitive i can get the variable but it needs a target and i don’t know what the target should be.

You have to enable “Editable” in the bool properties (when you use 4.6) + in the other bp you will have to get a “cast to” node. For that just add a “get player pawn/character” node - drag the link out from it - search for “cast to mycharacter” - choose the node. Now you can get the variable from that (drag the link out from the As My Character) :slight_smile:

oh shoot its not in MyCharacter. I have to Put it into MyController the InputAction only works in MyController for some reason. i have a cast to MyCharacter for the inventory array.

this is what i have

MyCntroller
http://postimg.org/image/efjbfavp1/

BP_HUD
http://postimg.org/image/uls828pi1/

should i do something like this?
http://postimg.org/image/4bl1874x7/

Yep, that should work :slight_smile: Otherwise connect the cast to controller directly with the event -> not over another cast (you can use the sequence node for that)

made it like this

http://postimg.org/image/s1vk5upzl/

the variable is editable but still doesn’t work.

and when i Hit I it works i can see it in the debug mode that it changes.

I figured it out why it wasn’t working.

This is what i had to do
http://postimg.org/image/mro91y67b/

Thanks for working with me fighter