Announcement

Collapse
No announcement yet.

Spawning items from class with struct problem

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

    Spawning items from class with struct problem

    Hi I'm having a little problem, I have a work around working but it is messy. There has to be an easier way. Looking at the 2nd picture should explain what the problem is quicker then reading all this.

    Here is what I am doing. My player is dropping ammo on the ground from his inventory and then the ammo dropped spawns as an ammo can with all the ammo that was dropped attributes with updated quantity and weight etc.

    When I spawn an item from class by manually choosing the class the "SpawnActor" node shows my master item blueprint struct because it is set to "expose on spawn" and that's what I want.
    Click image for larger version  Name:	 Views:	3 Size:	94.2 KB ID:	1376857

    Here is the problem,
    If I pull a class up from my item array and connect it to the SpawnActor node my master item struct goes missing why?
    Click image for larger version  Name:	 Views:	3 Size:	101.4 KB ID:	1376858
    Last edited by Cipher5; 10-28-2017, 06:53 PM.

    #2
    Make sure that your "Item Drop Transform Class" is a class of your specific type and not an "Actor Class"
    If your variable is "Actor Class" you only see exposed Members of Actor.

    Comment


      #3
      To make it so your "Spawn Actor" nodes displays "Expose on Spawn" variables, make sure to feed it with a Class of the type you're asking for. As Raildex mentionned.

      BUT if I'm correct sometimes it bugs and does not display the proper values. In this case, you can force display the value by casting your class into the class you want.

      In your case, I would get the purple pin, cast to your object type and feed the result of the cast inside the "Spawn Actor" node.
      [Released] Multiplayer Combat Editor
      A-RPG Sacred Swords
      Auto-Chess Live Development
      Youtube Tutorials

      Comment


        #4
        Is it one of those vars that you can expose on spawn?
        Sometimes especially if you change data types they seem to mess up.
        Try re-compiling with actors involved and put down a new fresh Spawn node?

        Comment


          #5
          Thanks everyone for your responses, I will try out your ideas and post back if it solved my problem

          Comment


            #6
            Thanks guys I have it working now. I casted to my BP item master class like Yun-Kun recommended and it kept the struct pin exposed. Works like a charm! I love learning new ways of doing things.
            Last edited by Cipher5; 10-31-2017, 09:02 PM.

            Comment

            Working...
            X