I’m losing my mind over this bug I’ve encountered.
- When I haven’t killed/disposed an enemy mesh in my scene the collision detection/pick up works perfectly on the health pack and the energy pack I have placed in my scene. The code for enemy kill is this and it’s called when the enemy health reaches 0:
The collision detection between the player-camera and the objects in my scene is handled by this code :
This is the code that describes a collectible/healthpack/energypack :
And this is how they look in the scene description:
healthpack being a cube that acts like a collision mesh and the healthpackmesh that acts like the actual model.
- When I have killed an enemy in the scene I can pick the health pack but not the energy pack. It detects the collision the sense that the camera stops moving when I go towards it but it doesn’t actually remove it nor it prints the name of it via the console.log call in the above picture.
It’s very hard/impossible to actually provide a playground due to the way my scene is structured.
It’s been a long time since I encountered this problem and I have no idea where to look so ANY suggestions would be soooo appreciated.