Godot Version
Godot.Net 4.2.1
Question
Hi,
i try to create a animation in C# and if i press the button “C” to play the animation.
What i have try?
- Create a AnimationPlayer
- Create AnimationLibrary
- Create a Animation
- Add a Track zu the Animation (TrackType.Scale3D)
- Add the Track zu Animation
- Add the Animation to the AnimationLibrary
- And add the AnimationLibrary to the AnimationPlayer
But if i press the C-Button and the C#-Code starts the animation with:
AnimationPlayer.Play(“CapsuleCrouch”);
I receive the error message, animation “CapsuleCrouch” not found.
This is my C#-Code:
// Add animation for crouching
AnimationPlayer = new AnimationPlayer();
AnimationLibrary AniLib = new AnimationLibrary();
Animation a = new Animation();
a.AddTrack(Animation.TrackType.Scale3D);
AniLib.AddAnimation("CapsuleCrouch", a);
AnimationPlayer.Name = "CapsuleCrouch";
AnimationPlayer.AddAnimationLibrary("CapsuleCrouch", AniLib);
AddChild(AnimationPlayer);
I have try to found a solution with google, but for C# ?
I hope anyone can help me. please
Best regards
Andy