How to get actor who shot projectile?
I have a weapon that fires a grenade, and I have a variable inside that blueprint that defines the explosion sound. How can I find the specific actor/blueprint that fired the projectile so I can get the specific sound in that blueprint and set the sound of the grenade to it?
asked Jan 30 '16 at 01:12 AM in Blueprint Scripting
Generally I'd define the the sound inside the abject that's using it. So if the grenade handles its own explosion the grenade would play the sound from it's OnExplode event.
If you have to define the sound in the weapon, add a variable to the grenade called Weapon and set the variables ExposeOnSpawn to true. In your weapon class, when you spawn the grenade with SpawnActorFromClass there'll be a pin on the spawn node for your weapon where you can set it to Self.
answered Jan 30 '16 at 01:35 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here