Download

Scene component with collision and movement?

Hey everyone, I’m building a few child blueprints that derive from the same parent class. Because each of the children have different shapes and functionality, I made the parent blueprint simply a scene component. However, I found that collision doesn’t work properly when a scene component is the root and also that functions such as AddActorOffset don’t work. Is there any way around this or am I doing something wrong?

Also, since it might be brought up, I have considered using an interface instead of making these blueprints all children. However, interfaces don’t let you carry over variables or define “virtual” functions and these blueprints share a lot of functionality.

Can you show the parent and one child?

Sure, I’ve attached a few images here. Resettable Object is the parent and Grabbable Object is the child. Yes, there isn’t a lot of functionality coming from Resettable Object right now, but I have some other classes with more functionality where it feels redundant to copy and paste a lot of code.

The main problem is in the third image, the Conveyor Belt. If I want to move normal objects (that is, objects where the root is NOT a scene component) like the player character, I can just take the root component and use AddWorldOffset to move it. However, this doesn’t seem to work with scene components, which is why I have a try-cast to Grabbable Object and move the cube component instead (since that works).

The collision issue was actually on a separate blueprint, but I solved that one by changing the Collision Enabled to Collision Enabled (Query and Physics).

I notice in the beginning you talk about using AddActorLocal… but in your BP you’re using AddWorld…

Did you try the actor version? Then at least you don’t need to worry about components getting left behind.