Download

Can blueprints selectively inherit other blueprints after construction?

I would like to animate a mesh/model by performing some simple offsets and rotations. EG: Jumping, rolling, and so on. I want the timescale on these animations to be flexible.

For example: If I were to perform a roll the default time to complete this action would take 1 second. However, my player or enemy could be sped up or slowed down altering the time. I figured the best way to do this would be use a timeline.

The problem is that I do not want to add every animation to every blueprint that may need them. It would make more sense to inherit as needed. Is this possible? I know you can’t use timers in functions, which make sense. You can spawn classes in C# and other languages and that class can have it’s own unique timers. Is something like this possible?

I think you would do this with components, not inheritance. You can add and remove components on runtime and construction script.

Thanks for the suggestion John. Are you referring to the blueprint script component option?

This unfortunately does not work as you cannot add timelines to script components.

You can’t add a timeline in the event graph of a component? I am talking about blueprint actor components or scene components.

Seems not possible (whyever) :frowning:

12b6d86be378a961edd323bf3e30313cc281f146.png

Yeah, it’s not possible to add a timeline to actor components.

I’d still like to know if there is a way to use timelines for such a thing but in the mean time I’m using the following as a work around.

AnimationTimeline is called per Event Tick

Offset Goal is the number I want to reach over time.

Animation Duration is how long I want it to take to reach Offset Goal.

Offset Total is just a variable used to track if I’ve reached Offset Goal yet.

If Offset Total >= Offset Goal then stop calling AnimationTimeline.

timeline_simulation.png