Announcement

Collapse
No announcement yet.

How to pass BP's varialble from Enum list and pass it another BP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to pass BP's varialble from Enum list and pass it another BP

    Hi,
    I'm trying to create setup where every weapon and spell is as standalone BP so i can create new spells and weapons with distinct properties (stored as values), like damage, or armor debuff and so on.
    Then i have Player Controller from where i shoot Line trace rays at enemies, and would like to pass properties of one of the weapon's BP to whatever raytrace hits.

    Problem is, with my current know how, i need to use 'Cast to' for every possible weapon or spell in order to get access to those properties, which is far from being optimal. Is there any way to make some universal system which can pass those properties?
    Those properties would be same for all them, just values would differ. If some skill is incompatible with some of the properties, like ammo clip for fireball, then that value would be zero. At least, this is how i imagine it should work.

    Is there a way to choose weapon from Enum list and then pass those properties to Player Controller?

    thank you,
    H

    #2
    Create an interface and apply it to your weapons. Then you can call the interface functions on any BP that implements it.
    Last edited by DevilsD; 08-03-2015, 02:01 AM.
    Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

    Comment


      #3
      is there any chance you could provide me with simple example? Thanks for looking at my problem, btw.


      EDIT: nvm, i got. thanks for inspiration!
      Last edited by Harcarik; 08-02-2015, 09:08 PM.

      Comment

      Working...
      X