Blueprint Communication not possible with same class?
I can't seem to access variables from another instance spawned from the same blueprint class, the "All Actions" menu only allows me to get the variable from the local instance.
I have a blueprint class, let's call it "Basic Unit" ( a unit which is a parent class for other units, friendly and enemy). When these run into other things, I get the hit result and cast it to "Basic Unit". I want to get a simple value from the hit object to determine friend or foe - but the hit object is another instance spawned of the same blueprint class, obviously. The context menu doesn't allow me to select the variable, only the local "get XXXX" which doesn't allow me to pass in a parent object / target reference.
I imagine this is because the editor is trying to "help" me because seeing it in there twice could be confusing. In C++ this would be no problem, but this project is in blueprint.
asked Jul 23 '15 at 03:08 AM in Blueprint Scripting
Personally, I would use an interface and a variable for this. Create a boolean variable 'Friend'. Set it true for friends, false for foes (obviously). The interface would then take your instance as a target, and call the function that would return the variable. No casting should be required.
answered Jul 23 '15 at 04:09 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here