Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Collision Component MUST be placed in root

See this topic: https://answers.unrealengine.com/questions/407501/projectiles-have-no-collision.html#answer-407615

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.


Product Version: UE 4.11
more ▼

asked Apr 19 '16 at 06:45 PM in Blueprint Scripting

avatar image

595 92 104 155

avatar image Sean L ♦♦ STAFF Apr 19 '16 at 06:58 PM


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?

avatar image Napoleonite Apr 19 '16 at 08:11 PM

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.
avatar image Napoleonite Apr 19 '16 at 08:11 PM

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.

avatar image Sean L ♦♦ STAFF Apr 20 '16 at 01:03 PM

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

avatar image Napoleonite Apr 20 '16 at 07:45 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Apr 22 '16 at 08:13 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 442

avatar image Napoleonite Apr 23 '16 at 07:55 AM

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?
avatar image Sean L ♦♦ STAFF Apr 27 '16 at 07:35 PM

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.

avatar image Napoleonite May 18 '16 at 10:19 PM

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:

alt text

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.

alt text

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.

bp2.png (7.9 kB)
bp.png (130.6 kB)
avatar image Sean L ♦♦ STAFF May 19 '16 at 05:15 PM

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.

avatar image Napoleonite May 22 '16 at 10:16 AM

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: https://answers.unrealengine.com/questions/220347/only-root-components-collision-is-being-detected.html

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question