dragonforge-dev / rpg_test_project

A Godot 3D RPG Test Project for learning and trying out new ideas.
MIT License
1 stars 0 forks source link

Implement Footstep sounds #8

Open dragonforge-dev opened 3 months ago

dragonforge-dev commented 3 months ago

This may require a Godot bug fix or more research. Currently I cannot get this to work.

dragonforge-dev commented 3 months ago

Code I removed from player_character.gd _physics_process() after tying to make this work. It worked, but played the sound incessantly.

    # Collision Detection for footstep sounds
    if is_player and velocity > Vector3.ZERO:
        for index in range(get_slide_collision_count()):
            var collision = get_slide_collision(index)
            if collision.get_collider() == null:
                continue

            if collision.get_collider().name.contains("tile"):
                $AnimationPlayer2.play("new_animation")