I have some custom Actors that can take in a float lerp value to control their animation. At present I have some simple trig functions on tick, but I want to be able to control this with a timeline that I create in Blueprints (because of the graphical interface) that outputs floats.
I’ve worked out how to (theoretically) get the floats back into my c++ via a BlueprintCallable function,
Can I create a Blueprint Timeline without making it a part of a Blueprint Actor. (I cant seem to create a timeline in Blueprints any other way - there is no BP timeline class I can use as a base as far as I can see)
How to access the timeline to send a play event? I tried making a function with UFUNCTION(BlueprintImplementableEvent), but it doesn’t show up in the graph. I’ve used this on other things like widgets and its working.
Ultimately I would like to store this timeline (as a pointer?) inside my C++Actor, I can see I can create timelines in C++, can I just copy the BP timeline over to C++ somewhow?
And some way for my code to access the Blueprint at runtime. I have built preloaders for many types of assets that grab assets before begin play…I would like to do this with the blueprints if possible?
Or is there a better way to do this?
- No, Timeline can’t be a separate thing, because it’s a Timeline Component, so it must be a component of an actor.
- A BlueprintImplementableEvent should show in the graph; The only way I can see it not showing is if your BP’s parent is not your C++ class.
- You can access BP Timelines in C++ code like this on BeginPlay(), for instance:
TArray<UActorComponent*> FoundComponents = GetComponentsByClass(UTimelineComponent::StaticClass());
for (UActorComponent* component : FoundComponents)
UTimelineComponent* timeline = Cast<UTimelineComponent>(component);
if (timeline != nullptr)
- As for timelines in general, there is of course a way to create and use them in C++. You will still create a curve (as a standalone asset in your project), so there’s your graphical interface, unless you mean something else. I still haven’t found a proper way to do what Event Tracks do in blueprint-based Timelines, but for floats C++ Timelines are okay, even if they require a bit more complicated setup than in blueprints.
Thanks, I will keeep working on this.
I had a basic model working some weeks ago that used curves in c++, but as the model is of a fully jointed hand, it got a bit tiresome and awkward to have to program 18 curves independently of eachother, hence wanting to take the ouput of a blueprint timeline where I can visually see the relationships.
- Yes, programming fatigue, I was not parented to the underlying c++ class! oops
Is there an automatic way to do a bool curve track - for triggering lights etc, or do I have to work this out manually? Im sure its not hard,