Is there a reason I can't derive from PrimitiveComponent?

I wanted to make an in-the-world targeting pointer for a character’s targeting system. The character would have the TargetingSystem actor component and it would work directly with a primitive component that would be the “pointer”. I noticed, however, that I was unable to create a custom Blueprint that derived from primitive component. I WAS able to just add a StaticMeshComponent with a cone to my character, but it got me wondering why I wouldn’t be able to make my own primitive components in the first place. I was initially thinking I could just right click in the Context Browser, hit Blueprint Class, and select PrimitiveComponent as the parent, but I realized I couldn’t. Is there a specific reason for this?

Nah, that doesn’t really work because there is no viewport that then allows me to see the component. I mean, if I really could create and edit my own PrimitiveComponents, then I would want to also be able to see it since they are renderable scene components by definition. The only thing I can do is make an actor, plop the pre-defined primitive component on, and then edit it how I want for the individual actor. It’s just weird that we have to use a work-around like that.

in C++ you can do anything, including make your own primitive components, but for your case, im not sure why you would want to.

if you want to be able to see a component in the 3D world, than you should use a mesh, because you can make a mesh look like anything. or if its 2D, you could use a billboard.

what did you want your component to do that a mesh cannot?

I have been attempting to create a game solely through the use of Blueprints (since they advertise that you can certainly do this), and despite the fact that I understand Blueprints are limited, I still want to let them know of what I, simulating a casual customer, am expecting to be able to do with the engine. I wanted to be able to add logic to the component that is rendered, and this doesn’t seem to be something that exists yet. The only type of “mesh” I can derive via Blueprints is a type of mesh actor (not component that attaches to an actor). Neither the ActorComponent nor the SceneComponent come with a Viewport in their Full Blueprint Editor, so there is no way to view the components explicitly without first placing them on an actor.

I have seen that there is an “Attach To” node that works with Actors so that an actor of any type can be attached to another actor, but that means I would have to make a whole new actor just for my actor component. What’s more, I would only be able to attach it dynamically via a Construction Script which, honestly, would work, but feels sort of over-complicated.

If I want to create my own renderable components, then I should be able to just derive my own primitive or mesh component, tinker around with the visuals in a viewport, add whatever logic to the component I want, and then attach it to the actor desired.

It’s also concerning that you cannot attach multiple components onto one another without using actors as a medium. To simulate THAT effect, I’d have to build everything I want into an Actor and then use the Attach To node mentioned before to attach the “Component Actor” that is housing and arranging the component system for me.

This would be very useful.

I’m running into this now. I wanted to create a custom set of box collisions that could be configured, but I had to end up putting them in an Actor and referencing them as ChildActorComponents (which involves some clunky casting to get at it’s member variables and functions). Being able to use a PrimitiveComponent as a parent in Blueprints would be nice.

It looks like you can select it as a parent when making a new C++ class though :confused: