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

Sliding Sound #125

Merged
merged 8 commits into from
Mar 29, 2024
Merged

Sliding Sound #125

merged 8 commits into from
Mar 29, 2024

Conversation

ac-arcana
Copy link
Collaborator

Added a sound to be played when crouch sliding.

Added a sound to be played when crouch sliding.
@Phazorknight
Copy link
Owner

Simple but pretty neat!

I think in the current implementation the directionality is too strong, might be better to just make the sound "2D" or use the quick audio add-on to play/spawn it.
The volume level also seemed quite inconsistent, one slide it was okay, the next slide it was very quiet.

@ac-arcana
Copy link
Collaborator Author

ac-arcana commented Mar 25, 2024

I want to stay away from 2D sound mainly because I want to support multiplayer with my project.

I didn't notice an inconsistent volume but I'll see if I can reproduce it and come up with a solution.

The quick audio might not work well because it wouldn't move the sound source with the player. I might give it a try and test that theory, though.

Utilizing Quick Sound in order to play the sound instead of a node.
@ac-arcana
Copy link
Collaborator Author

ac-arcana commented Mar 25, 2024

Okay, changed the play method to Quick Audio. You can keep a reference to a node and reparent it, so this allows the sound to follow the player. I have no idea why the volume was not consistent on the audio stream player and is consistent with this, but oh well. Seems to have fixed the consistency problem.

I would like to note that the Sound Effects volume setting currently seems to have no effect on these sounds. I was checking because I was curious if Quick Audio was adding SFX to the SFX bus.

@ac-arcana
Copy link
Collaborator Author

ac-arcana commented Mar 25, 2024

The part saying that the walk / sprint threshold needed to be made to variables started to bug me, so I've made those variables, too. I switched from length() to length_squared() on velocity to save a slight bit of performance.

I increased the threshold value to switch from walk to sprint slightly because I found I was usually triggering sprinting without holding the sprint button.

@Phazorknight
Copy link
Owner

I just gave this another try, and I am getting some errors:

image

This happened both when testing in the Lobby and Laboratory demo scene.

@ac-arcana
Copy link
Collaborator Author

Ah I didn't notice that. I think it's a problem with reparent. I probably need to defer the reparent call. I'll look at this some time this week to fix it

Also removed another debug print
@ac-arcana
Copy link
Collaborator Author

I believed I've fixed the error.
Also removed some other prints I left in when I was debugging

Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Thanks so much!

@Phazorknight Phazorknight merged commit 546b313 into Phazorknight:main Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants