-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I'm loding a gltf mesh with animations but can't use animation.
int currentFrame = 0;
ModelAnimation[] theAnim;
...
ReadOnlySpan<ModelAnimation> anims = ModelAnimation.LoadAnimations("resources/models/player/Robo.gltf");
theAnim = anims.ToArray();
Console.WriteLine($"*** Animation : {theAnim[0].Name}");
...
currentFrame = (currentFrame+1) % theAnim[0].FrameCount;
theAnim[0].Update(model, currentFrame);
and the result :
INFO: FILEIO: [resources/models/player/Robo.gltf] File loaded successfully
INFO: FILEIO: [resources/models/player/Robo.bin] File loaded successfully
INFO: MODEL: [resources/models/player/Robo.gltf] Loaded animation: Robo|Robo_Idle (469 frames, 7.966667s)
INFO: MODEL: [resources/models/player/Robo.gltf] Loaded animation: Robo|Robo_accelerate (57 frames, 0.966667s)
INFO: MODEL: [resources/models/player/Robo.gltf] Loaded animation: Robo|Robo_forward (116 frames, 1.966667s)
INFO: MODEL: [resources/models/player/Robo.gltf] Loaded animation: Robo|Robo_decelerate (57 frames, 0.966667s)
*** Animation : Robo|Robo_Idle
Fatal error. 0xC0000005
at Raylib_CSharp.Apis.RaylibApi.UpdateModelAnimation(Raylib_CSharp.Geometry.Model, Raylib_CSharp.Geometry.ModelAnimation, Int32)
at Raylib_CSharp.Geometry.ModelAnimation.Update(Raylib_CSharp.Geometry.Model, Int32)
at BattleAIviewer.Helper.Player.Draw()
at BattleAIviewer.Program.Main(System.String[])
I don't find what i'm doing wrong. Could someone please help me?