Use SpeedScale in Player.cs in part 9 of 3d tutorial

The C# alternative for the Godot code, was using a non existing `PlaybackSpeed` property instead of the same property used by the GDScript alternative: speed_scale (SpeedScale in C#).

As a result the C# alternative would not run, while the GDScript alternative worked just fine.
This commit is contained in:
Jafar Rahmati
2025-06-01 18:43:21 +02:00
committed by GitHub
parent 6ae63ddd5f
commit 9b9205f373

View File

@@ -451,11 +451,11 @@ Here's the *Player* script.
direction = direction.Normalized();
// Setting the basis property will affect the rotation of the node.
GetNode<Node3D>("Pivot").Basis = Basis.LookingAt(direction);
GetNode<AnimationPlayer>("AnimationPlayer").PlaybackSpeed = 4;
GetNode<AnimationPlayer>("AnimationPlayer").SpeedScale = 4;
}
else
{
GetNode<AnimationPlayer>("AnimationPlayer").PlaybackSpeed = 1;
GetNode<AnimationPlayer>("AnimationPlayer").SpeedScale = 1;
}
// Ground velocity