HOW TO DESTROY SPHERE COLLISION COMPONENT ON WEAPON ATTACHED TO THE CHARACTER WHEN I PICK UP THE WEAPON
I have a weapon with a sphere collision placed on the floor so that when I pickup the weapon and this one is attached to the character's back I want to destroy the Sphere Collision, however, it only destroy the sphere from the weapon that is on the floor and not the one from the character.
My character with four weapons on the floor with the Sphere Collision not hidden on the game:
When I pickup a weapon, the Sphere Collision of the weapon that is on the floor is destroyed and the one my character picks contain the sphere:
Here's another one in front of a mirror, you can see the sphere all around my character:
Part of my weapon blueprint scripting:
You could do an IsValid check on the interactable area component after you attach the weapon. If it is valid, destroy it.
answered Jan 04 '19 at 04:12 PM
I think what's happening is that youre casting to the wrong instance of the weapon. Try a for each loop an the weapons and branch it to check if the array element is equals to the picked up weapon the cast to it and destroy the sphere. Lemme know if it works.
answered Feb 16 '19 at 07:19 AM
Was Zamiel Grimwalkers suggestion correct? If so please mark it.
I'm a bit of a nub but my guess is that the instance you are acting on isn't the same instance as the actor on your back. In other words, unless you are translating that same actor for which you have destroyed the sphere to be on the players back, then you must be spawning a new actor, and this actor still contains the sphere you never destroyed. Either spawn a new actor that's the same without the sphere, or move the current actor. Idk which is easiest.
answered Mar 28 '19 at 09:49 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here