Download

Blueprint Class Component Default Overrides

Hey, I am trying to figure out the best way to setup “Default Component Templates” for blueprint generated classes.

First let me explain what I mean by Default Component Templates…

Let’s say I have an Actor class called “AWeaponItem”. I would like it that when a user is creating an AWeaponItem in the blueprint editor, and when they add various components, that they use default values set from C++.

For example, I would like all StaticMeshComponents to default to “NoCollision” as a collision profile, and I would like all ShapeComponents (Capsule, Box, Sphere) to default to “WeaponCollision” as a collision profile.

The obvious solution is by creating overrides - WeaponItemStaticMeshComponent, WeaponitemCapsule/Box/SphereComponent

This works, but it requires the creator to remember the various different types. Also, it starts getting really out of hand when you have to create overrides for many different Actor types.

I’m currently looking at casting the UClass to a UBlueprintGeneratedClass in the AActor derived constructor, and trying to mess with the InheritableComponentHandler - but this seems to be on an exact node basis.

I would ideally like a nice clean solution where I can simply specify certain component defaults per Actor type - but I am currently still looking…