If you use a "dummy" Player object in your Timeline, you can remap it to your "live" Player by checking Remap bindings? in the Engine: Control Timeline Action.
Hi Chris, can you elaborate further on the above? this dummy player object, is it just an instance of the prefab in scene? And what happens to it before and after the timeline? Thanks
If your Player is spawned in at runtime by the Settings Manager, but still want them controlled by Timelines, place an instance of the prefab into the scene while in Edit mode and control them in your Timeline.
You can remove their Player component while doing so, or remove them from the scene file before entering Play mode. Either way, you'll need to remap the tracks that rely on this instance to the runtime prefab via the option I mention above.
If still in the scene, the original Player copy used to create the Timeline tracks will no longer be referenced by the Timeline and so unaffected by its playback state.
Spine requires its own Timeline tracks, available on Spine's website.
Out of the box, it doesn't support rebinding - but this can be done for the Spine Animation State track type by modifying the top of the SpineAnimationStateMixerBehaviour script's ProcessFrame function to the following:
var skeletonAnimation = (playerData as GameObject).GetComponent<SkeletonAnimation> ();
var skeletonGraphic = (playerData as GameObject).GetComponent <SkeletonGraphic> ();
animationStateComponent = (playerData as GameObject).GetComponent <IAnimationStateComponent> ();
var skeletonComponent = (playerData as GameObject).GetComponent <ISkeletonComponent> ();
if (animationStateComponent.IsNullOrDestroyed() || skeletonComponent == null) return;
Hi, I get this error after adding the script without the code:
Assets/Sleepytime Village/Scripts/SpineAnimationStateMixerBehaviour.cs(201,31): error CS1061: 'IAnimationStateComponent' does not contain a definition for 'UnscaledTime' and no accessible extension method 'UnscaledTime' accepting a first argument of type 'IAnimationStateComponent' could be found (are you missing a using directive or an assembly reference?)
Comments
This is unrelated to AC, but a video on this topic can be found here.
If you use a "dummy" Player object in your Timeline, you can remap it to your "live" Player by checking Remap bindings? in the Engine: Control Timeline Action.
Hi Chris, can you elaborate further on the above? this dummy player object, is it just an instance of the prefab in scene? And what happens to it before and after the timeline? Thanks
If your Player is spawned in at runtime by the Settings Manager, but still want them controlled by Timelines, place an instance of the prefab into the scene while in Edit mode and control them in your Timeline.
You can remove their Player component while doing so, or remove them from the scene file before entering Play mode. Either way, you'll need to remap the tracks that rely on this instance to the runtime prefab via the option I mention above.
If still in the scene, the original Player copy used to create the Timeline tracks will no longer be referenced by the Timeline and so unaffected by its playback state.
Is this also possible with Spine animation?
Spine requires its own Timeline tracks, available on Spine's website.
Out of the box, it doesn't support rebinding - but this can be done for the Spine Animation State track type by modifying the top of the SpineAnimationStateMixerBehaviour script's ProcessFrame function to the following:
I do not have this script, and cannot seem to find it online, can you share please?
It's part of the Github:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs
Hi, I get this error after adding the script without the code:
Assets/Sleepytime Village/Scripts/SpineAnimationStateMixerBehaviour.cs(201,31): error CS1061: 'IAnimationStateComponent' does not contain a definition for 'UnscaledTime' and no accessible extension method 'UnscaledTime' accepting a first argument of type 'IAnimationStateComponent' could be found (are you missing a using directive or an assembly reference?)
Have you imported the script without the rest of the Github code?
This is not an AC issue.