Skip to content

Commit

Permalink
Merge pull request #248 from mrezai/fix-footstep-surface-detector
Browse files Browse the repository at this point in the history
Fix FootstepSurfaceDetector raycast bug
  • Loading branch information
Phazorknight authored Aug 22, 2024
2 parents dbcecb9 + d400b5d commit af995d5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ class_name FootstepSurfaceDetector
@export var generic_fallback_footstep_profile : AudioStreamRandomizer
@export var footstep_material_library : FootstepMaterialLibrary
var last_result
var parent_rid : RID


func _ready():
parent_rid = get_parent().get_rid()
if not generic_fallback_footstep_profile:
printerr("FootstepSurfaceDetector - No generic fallback footstep profile is assigned")

func play_footstep():
var query = PhysicsRayQueryParameters3D.create(global_position, global_position + Vector3(0, -1, 0))
query.exclude = [parent_rid]
var result = get_world_3d().direct_space_state.intersect_ray(query)
if result:

Expand Down

0 comments on commit af995d5

Please sign in to comment.