Collision Component MUST be placed in root

See this topic: Bouncing projectiles have no collision - World Creation - Unreal Engine Forums

This is such weird behavior + so bothersome when using inheritance that I assume that this is a bug. I mean we have like dozens of collision-settings but not adding a random collision-component (doesn’t even have to be the one you will be using) as the root will break ALL collision-checking for this object except for pawns.

Reproducible.

1 Like

Hello,

This seems to be working as intended, if I am understanding your issue correctly. In order for the collision to function properly, you’ll need to ensure that at the very least your mesh is parented to your collision box. In typical blueprints that I create, I try to ensure that the collision I want to use is set as the root, as this is intended workflow. When I followed your repro steps that you included in your linked post, moving the collision box to the root component slot ensured that I was able to get the collision to function as expected.

If you’ll notice on the default projectile included in the First Person Template, the collision is set as the root, which is necessary for it to function properly.

Also, I’m not sure what you mean by “break ALL collision-checking for this object except for pawns”. What sort of behavior are you seeing with your pawns?

I’m probably seeing it wrong as I’m fairly new to UE4 (again). But by having a DefaultRootComponent and then the CollisionComponent as a child of that and having “Simulate physics” unchecked: will not fire any hits/overlaps regardless of any settings and the object does not interact with any other object in the world (so it will fall/move through other objects). But it WILL generate hit/collapse events with pawns like enemies and players but ONLY with them.

The above behavior is weird to me personally. But I may have done something wrong somewhere.

moving the collision box to the root component slot ensured that I was able to get the collision to function as expected.
Yes. The moment I use the DefaultRootComponent, no matter how I configure everything or where I attach the Mesh or other collision components, no collision will work for this object other than hitting/overlapping pawns.

If you’ll notice on the default projectile included in the First Person Template, the collision is set as the root, which is necessary for it to function properly.
Yes I figured that out after like a whole day… Doing this will make everything work properly. Searching high and low on the web and on this hub and I couldn’t find the answer to my problem and nobody was explaining it anywhere that I could find regarding projectiles.

For me it becomes especially odd the moment I have a BaseProjectileBP (with a SphereCollision) and then a child blueprint named LaserProjectileBP which requires a CapsuleCollision. But I have a SphereCollision inherited from the base-class. Not because I want too but because I’m forced too by this design to add a random CollisionComponent to my BaseProjectileBP.
And I can not add a UShapeComponent to the SceneRoot (as that would allow me to replace it with a capsule in the child). So the usual override methods will all not work… Sure there are workarounds but… So complicated for something so odd that could have been so simple…

Also it would be nice if the tooltip of the DefaultRootComponent would clearly tell me that NOT replacing it (with a CollisionComponent) will cause weird collision-detection behavior and mostly none at all.
Because it’s not just about replacing it, it also MUST BE a CollisionComponent. In all other cases collision wont work fine. If you add a pointlight as the root and attach the collisions and meshes to that pointlight, it will not work. To me the order of such a tree having such a big impact on collision-detection is odd.

But perhaps I’m overlooking something.

If you’d like, you can provide a test project and I can take a look at your setup to determine if there is an issue with the collision not functioning properly.

You can zip up the project, upload it to Dropbox, and provide me with a link through a PM on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

I sent you a PM with tiny sample project showing the ‘problem’ I have. Thanks for looking into things both on the AnswerHub and into demo projects.

Hello Napoleon,

After taking a look at your setup, I do not recommend this workflow. What you seem to be doing is attempting to use the static mesh from the original blueprint, but use a different collision for it. If you need that level of alteration, I’d recommend using a completely new blueprint, or setting up the base class so that it is as bare as possible except for maybe some very simple functionality.

Let me know if you have any further questions.

Have a great day

Hello Sean,

But why does the CollisionComponent that is NOT the SceneRoot-component work only against pawns as seen in the sample project? Intended? And if yes, why? You can clearly see this with the printed message on gamestart (only 1 printed message but there should be 3. 1 for hitting the player, and 2x1 for hitting the BSP).

setting up the base class so that it is as bare as possible
Yes I know but how? UE4 kinda forces me to design it in such a way that the base-blueprint must have a collision-component on the root. Which of course can not be a UShape component instead so I can’t switch it to another collision-component in a child blueprint. Also I do not seem to be able to attach multiple-working-CollisionComponents to the same blueprint because only the one in the root will work properly. So how does one do this?

Something that might be useful in your setup is making use of child actor components. When you want another piece of the blueprint to have it’s own collision, create a separate blueprint and then add a Child Actor component that is set to that separate blueprint class. This would allow you to get the desired results while still maintaining a solid workflow.

I did that. Didn’t work either. The projectile moves, but it does not collide with anything in the world. Also setting it to “block all” still does nothing because collision seems not to work at all:

So I tried unchecking the auto-register-component in the projectilemovementcomponent and setting it manually to a collisioncomponent that is not the root-component in the blueprint-construction-script. Sadly that prevents the projectile from moving and may in some cases even crash the editor.

91111-bp2.png

Can someone please give me a very detailed answer on how to support multiple collision-shapes within the same projectile-class? I asked a guy with 1.5 years of UE4 experience and ~20 years overall and even he didn’t know how to solve this. We also tried overriding the ProjectileMovementClass but it doesn’t like that and it seems to really require a root-component as the collision.

All other people I asked all seem to be using the same shape for ALL projectiles in their game because they too could not figure it out.

After spending some more time testing your project, we haven’t been able to reproduce the error that you are experiencing. If you can provide steps to consistently reproduce this error in a clean project, then we can investigate this issue and determine if a bug report needs to be entered, or if there is an issue with workflow.

Maybe I’m just bad at explaining it.

Here is another post about it from someone else (with a c++ workaround) with a somewhat more simplified problem: