Casting not working , not player character

If u just wish to edit bool in another BP then save mains charac reference in BP in which u have to save bool by casting at begin play and then you can access the bool in the main BP which u then can set in that BP