Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationPlayer CallMethod Track causes issues with other animation tracks of the same node. #94685

Closed
cprosser-3 opened this issue Jul 24, 2024 · 4 comments

Comments

@cprosser-3
Copy link

Tested versions

4.3 Beta

System information

Windows 10 - Godot 4.3 Beta - Forward+

Issue description

CallMethod Track causes issues with other animation tracks on the same node. If the CallMethod Track is first, the other tracks will not work. If the CallMethod Track is not first, it will not work. Tested in both C# and GDScript as suggested.

Steps to reproduce

From a new project:

Create MeshInstance3D named Floor.
Select a New PlaneMesh and resize to 20x20.
As a child node of Floor, add a Camera3D.
As a child node of Floor, add a CharacterBody3D named Character.
As a child node of Character, add a MeshInstance3D and select a New CapsuleMesh.
Attach the appropriate script below to Character and build the project.
In the 3D viewer, move Character in front of the Camera3D.
As a child node of Character, add an AnimationPlayer.
Add a new animation to the AnimationPlayer called "Test" and set it to Looping.

Add a CallMethod Track for Character.
Add key frames for the F1() and F2() methods at any point within the track.
Run in Debug. "1" and "2" will print as expected.

Add a Position Track for Character.
Add key frames with a new position for Character at any point within the track.
Run in Debug. "1" and "2" will print, but Character will not move.

Delete the CallMethod Track.
Run in Debug. Character will now move.

Re-add the CallMethod Track with F1() and F2() at any points on the new track.
Run in Debug. Character will move, but "1" and "2" will not print.

Results are the same using C# or GDScript.
Note: Adding additional tracks like a Rotation Track, will have Character both move and rotate as expected. Only CallMethod Track doesn't work.

using Godot;

public partial class Character : CharacterBody3D
{
    public override void _Ready()
    {
        GetNode<AnimationPlayer>("AnimationPlayer").Play("Test");
    }


    public void F1()
    {
        GD.Print("1");
    }


    public void F2()
    {
        GD.Print("2");
    }
}
extends CharacterBody3D

func _ready():
    get_node("AnimationPlayer").play("Test")
	
func F1():
    print("1")
	
	
func F2():
    print("2")

Minimal reproduction project (MRP)

CallMethodTrackTest_CS.zip
CallMethodTrackTest_GD.zip

@TokageItLab
Copy link
Member

Alright I see the problem and sent fix #94716, please test it if you can.

@TokageItLab TokageItLab added this to the 4.3 milestone Jul 25, 2024
@cprosser-3
Copy link
Author

Reading the "Building from Source" page, I don't think my machine is setup to test branches. If it is holding up the merge I can make some time to set it up though.

@akien-mga
Copy link
Member

Fixed by #94716.

Reading the "Building from Source" page, I don't think my machine is setup to test branches. If it is holding up the merge I can make some time to set it up though.

You can test by downloading artifacts from CI, see https://docs.godotengine.org/en/stable/contributing/workflow/testing_pull_requests.html

@cprosser-3
Copy link
Author

Oh, that's so good to know and it works great too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants