Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FootstepSurfaceDetector raycast bug #248

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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