I've explained this so many times in many posts, but people keep making the same two mistakes:
- You should never use Trigger Once condition with objects that have multiple instances. Trigger Once doesn't work per instance!
- You have events that run on every tick with Wait action in them. This creates lots of delayed threads, which will continue running for several seconds. Never use "wait" in events that run on every tick! It will break the game logic.
Instead of "Trigger once" use some condition like "is pinned" or "turret enabled". Instead of "Wait" use the Timer behavior to destroy guns.
I've almost perfected the function. One problem I have now is that when I create the gun very quickly, the base gets destroyed quickly before unpinning the machine gun. This error happens when I create guns quickly in a shorter period; if I create them slowly, it works perfectly. Can you please help me fix this?
Create:
Destroy:
Error Video: webmshare.com/play/bG6zm