chore: added look_at_movement parameter

This commit is contained in:
Sara Gerretsen 2026-04-29 14:05:09 +02:00
parent 1ec9862c95
commit 302b7fc2ac
2 changed files with 3 additions and 3 deletions

View file

@ -5,10 +5,10 @@ void PlayerMovementAction::_bind_methods() {
BIND_PROPERTY(Variant::FLOAT, target_speed);
BIND_PROPERTY(Variant::FLOAT, acceleration);
BIND_PROPERTY(Variant::FLOAT, deceleration);
ClassDB::bind_method(D_METHOD("process_movement"), &self_type::process_movement);
ClassDB::bind_method(D_METHOD("process_movement", "look_at_movement"), &self_type::process_movement);
}
void PlayerMovementAction::process_movement() {
void PlayerMovementAction::process_movement(bool look_at_movement) {
ERR_FAIL_COND_EDMSG(get_blackboard() == nullptr, "Parent behaviour tree of PlayerMovementAction is not a PlayerBehaviourTree");
double const delta{ get_process_delta_time() };
Vector3 target_velocity{ get_blackboard()->get_world_move_input().normalized() * this->target_speed };

View file

@ -8,7 +8,7 @@ class PlayerMovementAction : public PlayerAction {
static void _bind_methods();
public:
void process_movement();
void process_movement(bool look_at_movement);
private:
float target_speed{ 5.f };