Considering that:
- Player can interact with it, or there is some gameplay event that can trigger its animation.
- Door might use a state tree (unless not recommended?).
- Current door state (open, closed, opening or closing) can be “saved”, to be “loaded” into said state, later.
- Animation can be “saved” at a certain time, to be resumed when “loaded”.
- Specific audio needs to play at specific times during animation.
Is it Level Sequence, simple Timeline, or other?
Thanks.
1 Like
The are many ways the player can interact with an object, but two very common methods are:
-
. Overlap volume
. Line trace
Also, I’d recommend using
A simple timeline works well ( unless you want to use skeletal animation ), and I’m recommend using Play and Reverse, rather than Play from start and Reverse from end. That’s because it’s much easier to program for players spamming the door that way.
Also, if the timeline is in the parent, you can operate it from a child by overriding the various events.
The saving and loading you have to do in the parent blueprint, using a save game, naturally. But there’s no point in saving ‘mid animation’ because the player is never going to see or appreciate that level of subtlety. Just saving whether it’s open / closed / locked / unlocked is enough.
You can put code in the parent to play open and close sounds, that you only actually specify in the child blueprints.
Level sequence is a bad idea. If you want to put the door in another level, you have to do all the work again.
1 Like
Yeah, I guess I need an animation that can be re-used on multiple actors, anywhere. For example, a simple rotation, that can be triggered by code.
But there has to be something more complex than just timeline, which has no control over audio, for example. Something that can trigger events throughout the track, or have configurable parameters, like which actor to animate, which sounds to play on which keyframe, stuff like that.
1 Like
Anything particular goes in the child. All this sounds like child stuff.
The main timeline just passes and 0-1 float that can be used in a lerp, without having to constantly make a new timeline.
A TL can control audio, you can have 4 or more exec points that can call things. I can’t believe a door animation needs more than this.
Also, if you really want organic / variable sounding effects, a better place to program this would be in a metasound.
1 Like
That would be a timeline, take a look at event tracks.
1 Like
I use play from start and reverse from end, but I check Is Playing before I apply the requested action. Overall it depends on your intended mechanics. Server authed states. Clients have to RPC on successful local interaction, server attempts interaction then applies action.
Also should note that for net optimization during transitions the interactive collisions are disabled to prevent wasted RPCs.
1 Like
Thanks. I know the title says “door” because I wanted to get guidance for a concrete example, but I’d be using this method to animate most, if not all my in-game objects (NOT characters).
I’ve only played with timelines a bit, I don’t know much about other methods. I don’t want to commit to one, only to find out later I wasted time and need to re-do, because of some limitation.
Timelines for example, can’t be used in state tree tasks.
I know there’s ways to do anything, but I’m looking for a method that the engine is already expecting you to use, for simplicity and efficiency. I don’t want to be fighting the engine with workarounds.
What do you think about Actor Sequence Component. Would that be an option?
1 Like
Yes, sorry, it’s hard to know how general you wanted this to be 
I’ve never even tried an actor sequence component.
1 Like