Răsfoiți Sursa

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.
Jafar Rahmati 2 luni în urmă
părinte
comite
9b9205f373
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      getting_started/first_3d_game/09.adding_animations.rst

+ 2 - 2
getting_started/first_3d_game/09.adding_animations.rst

@@ -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