How do i GET VARIABLE in a different Blueprint, than where i SET VARIABLE?
Hello everybody I hope I am doing nothing wrong here, since this is my very first post that I'm creating myself. Until now I somehow always managed to find a way getting things to work watching YouTube videos or reading other posts on here but now I got stuck. I'm not a native english speaker, but I'll try my best to describe my problem as precice as i can and hopefully some of you guys can help me :)
Right now it is about "picking up a Flashlight" that I can only toggle on and off when the Flashlight_Actor is destroyed.
(I need to GET "PlayerHasFlashlight Bool" from "Flashlight_Blueprint"... to my "PlayerChar_BP")
I already set everything up, but I cant figure out how to GET a "SET VARIABLE" in an other Blueprint, than where I createt (SET) it. I could find a lot of different things about this, like the use of "cast to", "make reference" or "make Variable Editable" but It was all quite different than what I expectet and I couldn't get it to work. I am still pretty new to UE4 and I was just wondering if there is an easier way to do this. Just adding a "get VARIABLE" node in the other blueprint doesnt work for sure, but maybe something similar is possible?.. Not asking for someone to do my work, but maybe some of you have a good advice, a source, video or maybe even a book that you can recommend me, to learn this. It is important to me, to not just fix THIS specific issue. I really want to understand how this kind of communication works.
I'm looking forward to your responses :) Greetings from Germany, and have a nice day.
asked Aug 06 '17 at 11:54 AM in Blueprint Scripting
In player character class add boolean variable like IsHaveFlashlight.
In flashlight actor, before it destroyed, get player character, cast it to your character class and set IsHaveFlashlight to true.
Now use it as condition to turn on/off flashlight component in character.
Also this must be stored in saves, as any additional ability.
answered Aug 06 '17 at 12:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here