When you spawn your C4 from the ReturnValue drag of the pin and create a variable. This way you have a reference. From this reference you can then get the ActorTransform and spawn your explosion. After that destroy both.
I’m trying to make c4 for a project I am working on.
Currently I have given the player the ability to place the c4 at the press of a button. (Shown below)
This works perfectly as the C4 CLASS is referenced and spawned at a target point in the player’s hand.
The difficulty arises when I tried to add the ability to explode the C4.
The way I want this to work is by spawning a damage volume (this is the C4 EXPLOSION object) on the location of the C4 for a split second (0.1 seconds) before destroying both the C4 and the C4 EXPLOSION.
This does not work, however. Not even so much as an error in the error log. I believe the problem to be getting a reference to the C4 object as it is not in the scene from the start (Rather placed by the player themselves). In this particular screenshot, I have not referenced the C4 EXPLOSION object, although that is not the issue.
I would like some help getting a reference for the C4 object itself after it is spawned and then spawning a C4 EXPLOSION object onto it.
Thanks for any help!
It’s easier to make the C4 blueprint so that it also accepts input and can respond to the C key. Then you can spawn the explosion in the C4, which is also more logical.
Sorry for replying so late!
Thank you so much! This really helped with the problem I was having!
However there is still a small error if you wouldn’t mind helping out just a little bit more.
When detonating the c4, the explosion only effects the last placed object, meaning any c4 placed before it does not explode.
Is there any way I could make all the c4 explode at once?
Thanks and here is my current blueprint: