The function I want is:
- The player will create a machine gun.
- Each machine gun will have a duration (lifetime) when it’s created.
- The machine gun should be destroyed when its time is over.
I couldn’t create a separate function for each instance. When I spawn only one machine gun, it works fine. But if I spawn more than one, it doesn’t work as expected.
Video showing the functionality I need: webmshare.com/play/dGjGx
Events for creating: i.vgy.me/jDLomT.png
Event for destroying: i.vgy.me/cM1COn.png
Video showing the error: webmshare.com/play/VbLbj