- Home /
Record Animation clip and timeline at runtime
I have a unity project that create an animationclip(using setCurve) and add it into timeline, also i'm using unityRecorder to add recorderTrack and clip to timeline for record the gameobject when it was playing.
At begining it works perfectly in unity, when i tried to generate an executable i got an build error due to unity recorder, i found the problem was the using unityEditor. The solution is put #if Unity_Editor directive and #endif after it. The problem is the code inside of this tag won't work at runtime of executable. How can i do to could use unity recorder in runtime? or which alternative unity has like unity recorder to record timeline animaiton?
Another problem i have is about the animationclip. the clip must be legacy true to could use setCurve(). if i turn clip as legacy true, i got another error that timeline doesn't support legacy animationclip. I tried to create an legacy clip to use setCurve and change legacy to false before add it to timeline. this time i don't got any error but the animation wasn't played at runtime.
Answer by cgiles · Jun 24, 2020 at 02:51 PM
In the documentation, it is specified that the recorder only works in the editor :
https://docs.unity3d.com/Packages/com.unity.recorder@2.0/manual/index.html
NOTE You can only use the Recorder in the Unity Editor. It does not work in standalone Unity Players or builds.
Oh sorry, i didn't see it before, i should check the documentation more detail. Do you know what alternative Unity has like unityRecorder to record the animation at runtime? UnityRecorder was exactly what i looking for, record the animation played by timeline and store it at video file.
Your answer
Follow this Question
Related Questions
Can't fully edit recorded animation after conversion to clip track. 0 Answers
How can I slow down to stop(HumanoidIdle) character when getting close to a object using timeline ? 0 Answers
Play on awake corrupt timeline behavior 2 Answers
How to make a model move during timeline in Cinemachine. 0 Answers