Download

Tickable Class

Hi everyone,

I’m attempting to do a metabolism actor component for my characters in my game

This class will contain member like legs, hands, feet, arms etc. Each of them will contain other class like skin muscle bones.
It will be a lot of informations to interact with. For example if you get hit on your leg, i’ll add a wound in the skin object of my right leg.

Now you have the context, i don’t know what kind of class i can use for my subcomponents.

At the moment, i’m using actor component base class because it can tick.
I’ll have a lot of stuff that need tick handling.
But because i’ve met many problems with the “construct object of class” function with this type of object (actor componenents),
I’m wondering there will be a better solution for my object.

I’ve seen that you can implement interface in your object but the one i need : FTickableGameObject doesn’t seem to be implementable in a class with Object Class as parent.

So my question is :

Is there a good parent class for an object that only need to tick and have a construct function ?

I know i may be able to do it in c++ but for the sake of my sparetime i’m trying to avoid c++ coding (and because other people working with me are not dev).

Thanks for reading, hoping someone be able to help me

[Edit]

I’ve done more research and more test and more stuff :

So it seems to be impossible to manage time with an UObject derived class and i don’t know why.
Because there is things you simply can’t do if it is the case.
Here is the dilema :

I have an actor, i want him to have an object attribute that can be added on runtime and that should do a delay
For example i have my character actor, when he get it i want to add a wound object in this actor attribute named Wounds(an array of wound)
When i create this wound i want it to substract blood every 1 sec so i want to use a timer, a delay or something related with time.

if class derived from actorComponents :

I can make a delay
I can make a timer
I can use on tick()
But i can’t add an actorComponents in my array when my character is hit

So actor components can’t be the solution

If class derived from UObject :

I can add a UObject in my array when my character is hit
I can make a timer
But i can’t clear the timer
I can’t make a delay
I can’t use on tick()

UObject can’t be the solution.

And i’ve been looking for class that would do the job but still doesn’t found one.
How can it be possible that there is no way to do what i’m willing to do.
It’s not absurd or very complex.
Just adding an object in an actor on runtime that can handling timer. Nothing dramatic.