Download

Actor spawned through another actor has access to the other actor's variables?

So basically I have a character (other actor), and the character has a gun, now when the character “holsters” the gun, I want the gun to be thrown away and disappear using a dissolve effect. I have all of this implemented in a way that when the character holsters the gun, I spawn a “dissolve_Actor” with an empty skeletal mesh inside it and all the dissolve code is inside that actor. As the actor is spawned, I set my character’s gun skeletal mesh as the skeletal mesh of that actor.

All works dandy and fine except that the dissolve actor is dissolving the gun in the character’s BP instead of it’s own. In fact, it isn’t even showing it’s own skeletal mesh to have been replaced by the character’s gun

TLDR: Dissolve Actor dissolving the gun inside Character BP and not the inside itself.

1 Like

It’s hardly surprising, as you are passing the character’s gun in as a parameter :wink:

The dissolve actor needs to dissolve it’s own mesh. If you want that to be changeable, then you can pass it in as a class reference.

ooooohh. I thought that by passing it through like that, The actor would have it’s own. nvm, could you tell me how do I pass it as a Class Reference?

Ok, I take that back, maybe you need to pass in the kind of skeletal mesh as a param.

In the character, you do the spawn, but in the dissolve actor you need to use ‘add skeletal mesh component’, I think…

Hmm okay I’ll play around with that node and see what I can come up with. Will update regarding output

[ 2nd pic is dissolve BP ]

2 Likes

You beat me to it! I just made the exact solution! :smiley:
I also took the skeletal mesh object reference from the Skeletal Mesh Component and passed that to a Skeletal Mesh Object variable inside the Dissolve BP. Then simply had to use the “Set Skeletal Mesh” node with the Dissolve’s Skeletal Mesh Component and it create a separate object for itself : >

Thank you so much!

Notice you dont have to do the SET if you expose the param :slight_smile:

image

ooh excellent! I love these little optimization tricks! :smiley:

also, how do I do this? I don’t see any checkbox in component details…

Select the parameter, and look for ‘expose on spawn’.

thank you!

1 Like