I am trying to follow the tutorial
but I tired to code the programs in C#
my code
Actor.cs
using Godot;
public class Actor : KinematicBody2D
{
private int gravity = 1000;
public Vector2 velocity = new Vector2(0, 0);
public Vector2 speed = new Vector2(100, 0);
public override void _PhysicsProcess(float delta) {
// gravity script
velocity.y += gravity * delta;
velocity = MoveAndSlide(velocity);
GD.Print("In Action Physics");
}
}
Player.cs
using Godot;
public class Player : Actor
{
private float direction;
private Vector2 character_direction;
public override void _PhysicsProcess(float delta) {
// movement script
direction = Input.GetActionStrength("move_right") - Input.GetActionStrength("move_left");
character_direction = new Vector2(direction, 0);
velocity = speed * character_direction;
GD.Print("In Player Physics")
}
}
The player.cs is attached to the Game Objet
Everything else works, but after I added _PhysicsProcess in child script, the parent script physics is not getting called at all . Can any one help me to run both the physics scripts ?