Announcement

Collapse
No announcement yet.

Object Wild card on A weapon when used in UI widget

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

    Object Wild card on A weapon when used in UI widget

    Okay....so everything works great for weapon select, bringing up menus etc
    But the problem i'm currently having is setting the varibales for the text in the menu to show the current weapon stats.

    I have a few
    Damage: <min> - <max>
    Critical Chance: <percent>
    Critical Multiplier: <#>

    Etc.
    This is pretty easy with the character. Cast to the HeroBP, get player pawn.

    When you select any weapon, it destroys the current one, then spawns actor, attach to socket all that stuff.

    So in the Widget i have: cast to BP_RevolverWP
    i am able to pull out the variables I want and everything. But it wont compile as there is no object. What would i use?

    #2
    Hello,
    You may can use a struct that you set will all informations you need, weapon by weapon. You put it in player controller or character , depends how you did things. Then from player controller / character reference in your widget you get your struct and all infos you need from it to dispatch.

    Comment


      #3
      Originally posted by Fen View Post
      Hello,
      You may can use a struct that you set will all informations you need, weapon by weapon. You put it in player controller or character , depends how you did things. Then from player controller / character reference in your widget you get your struct and all infos you need from it to dispatch.
      I actually just logged in to post the solution I had found.
      To allow the current weapon to always be able to be destroyed (along with a few other action/events i have) my solution was an object variable on the player "WeaponEquipped"

      So I'm pretty sure that's exactly what you meant....and I had learned to do but, forgot


      In the widget i cast the HeroBP get player pawn. Then cast to the BP_RevolverWP.
      As the hero i get WeaponEquipped and plugged it into the wild card.
      Compiled just perfect and everything updated just fine.

      Thank you for the quick response. I think i was avoiding that a bit because I felt like I was looping in circles....spawn weapon, copy info to variable, call character to call variable to call weapon and reference the variable to pull information
      Seemed like i should have just been able to call the variable from the weapon. But most of them get stored with the character as I destroy/spawn them all the time

      Comment

      Working...
      X