Download

Ignitable component for candles, torches

Hello,

I’m trying to re-imagine different game mechanics from existing games for VR.
Now I’d like to work on candles and torches from Tomb Raider and Thief:

My first idea was to create an Ignitable custom component that can be added to an Actor where a flame would be like this:
candle_ignitable_comp.PNG

It would handle collisions with torches or other fire sources and then would create the flame and particles.

But as I noticed I cannot add any components to this component. I would have added a SphereComponent.

How should I do this to be as modular as it can be?

Still not much.
I can link a collision sphere to the component like in physics constraints but then goes to (best) check if two of these overlap? (burning torch and candle to be lit)

You can’t add components to components.

In order to create a Blueprint component based on a SphereComponent, but that type is not available in the list of BP Component as I’m sure you’ve noticed.

You will first need to create a C++ Component (this can be done through the engine, the same way you create a Blueprint Component) based on SphereComponent. Then you will need to add the **Blueprintable **specifier in the UCLASS macro of your C++ component (look up the documentation on how to create C++ components if you dont know what this means).

That will then make your custom C++ SphereComponent appear in the list of Component types you can create a Blueprint Component from (when you go to create a BP Component).

Create your Blueprint Component based on that custom C++ type and voila, you now have a BP Component with an embedded sphere collision, which you can access inside of the component’s eventgraph.

As for the VFX, what I would do is spawn the VFX inside the component, and attach it to the component.