I have a problem with my collision detection for my projectiles.
I have a pawn with a box collision (set to be blocked by the environnement), from this pawn I inherit other pawns with custom projectiles with meshs that i used as projectiles in my project (the collision of theses projectiles’ mesh have been disabled) but theses pawns keep the box collision from the original pawn.
When I shot my projectile, the mesh move properly but the box collision stay here and don’t move at all even if box collision and the mesh are in the same scene root component.
And because the box collision stay here, my projectiles don’t collide on anything
First, why 2 components in the same scene root could move differently, there are not suposed to be linked by their transform gizmo ?
And how can I fix that my projectiles collide as I want ?
Here, screens on one of my projectiles and a screen in-game (with rendered box collision to show you that they don’t move).
Are you sure collision is completely disabled on your StaticMesh? Can you post screenshots of the Blueprint or post the C++ code that handles movement?
If you are using ProjectileMovementComponent to move your stuff, then you want to disable physics on your components. ProjectileMovementComponent has its own movement logic that doesn’t use PhysX/rigid body physics to simulate movement. I’m not sure what happens if you try to use it and have physics enabled at the same time.
If you want the projectile to have rigid body physics (bouncing, spinning), you should remove ProjectileMovementComponent and re-enable rigid body physics, and then apply force to the rigid body to make the projectile move.
If you just want the projectile to be destroyed when it hits the wall, leave it the way you have it now, make sure that you have ‘block’ set for both the wall and the projectile, and make sure you have the projectile’s object type set to WorldDynamic (or something like that, but not WorldStatic). Then, you’ll want to use Blueprint to listen for when the projectile collides with something, and then play some explosion effect, destroy the projectile, deal damage to the thing the projectile hit, and whatever else you want to do.
Hi, I’ve had a similar issue which a night’s sleep has helped me fix. I’m still a beginner so forgive me if this is wrong, but try making the collision component the root of your actor (and delete the scene component). It seems to me that a projectile component reads movement only from the root.