x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.16
Tags:
more ▼

asked Aug 06 '17 at 11:54 AM in Blueprint Scripting

avatar image

XynoTV
5 1 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Aug 06 '17 at 12:19 PM

avatar image

redbox
4.3k 80 17 104

avatar image XynoTV Aug 06 '17 at 02:21 PM

thank you for the quick reply! :D I will try to do that now :)

avatar image XynoTV Aug 06 '17 at 02:37 PM

Oh my god! It worked with the first try! x_x You are my hero! :D Thank you soo much! : 3 Because of you I now also understand how "casting to.." works !!! :D Just have to figure out now how to cancel On/Off sound when I DontHaveFlashlight, but I guess I will be able to do that :)

Here 2 more screenshots for all the people who experienced the same problem :) And again, THANK YOU A LOT, Sir! :3!

(Can I somehow give you a thumb up, or something like that to support you?) Would be happy to do so :) alt text

avatar image XynoTV Aug 06 '17 at 02:44 PM

fixing the Flashlight-Sound Issue was easy. Just had to delet my first "input action flashlight event" and everything that was connected to it :) Cheers to every dev out there. Hope it helps.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question