08-14-2019, 07:36 PM
As said by @kbartek you must point out which game engine are you working on. Without this information we can't provide a proper help. Moreover, I suggest you to use services such as Pastebin or GitGists to share code snippets, they support specific-language formatting and styling that makes reading easier.
Regarding your problem, I think you need to handle the CollisionEvent between your PlayerEntity and your MinigunEntity, when it happens you just need to remove MinigunEntity from your Scene and do your things on PlayerEntity.
So, presuming you are using Unity, here some good articles about Collisions that can help you figure out how to properly handle them: I hope this will help you.
Regarding your problem, I think you need to handle the CollisionEvent between your PlayerEntity and your MinigunEntity, when it happens you just need to remove MinigunEntity from your Scene and do your things on PlayerEntity.
So, presuming you are using Unity, here some good articles about Collisions that can help you figure out how to properly handle them: I hope this will help you.