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

FmodListener2D references get lost #291

Closed
timoschwarzer opened this issue Dec 13, 2024 · 3 comments · Fixed by #295
Closed

FmodListener2D references get lost #291

timoschwarzer opened this issue Dec 13, 2024 · 3 comments · Fixed by #295
Labels
bug Something isn't working

Comments

@timoschwarzer
Copy link

timoschwarzer commented Dec 13, 2024

I have set default_listener_count to 2 and added two FmodListener2D nodes to the tree. One of them has listener_index = 0, the other has listener_index = 1. Both of them have a weight of 0.5 and are not locked.

After some debugging, I noticed that FmodServer.get_listener_transform2d(0) always returns a zero transform.
FmodServer.get_object_attached_to_listener(0) returns some weird [Wrapped:0] object, and FmodServer.get_object_attached_to_listener(1) returns <Object#null>, so something seems to cause listeners[i].gameObj to become invalid.

Replacing these nodes with custom nodes and adding them manually using FmodServer.add_listener(0, self) in GDScript works.

Godot Version 4.4-dev
Addon Version: 5.0.0-4.3.0

@piiertho piiertho added the bug Something isn't working label Dec 15, 2024
@piiertho
Copy link
Member

Hello ! Are those listeners added to the scene via the editors, or do you add them programmatically and then set their index ?

@timoschwarzer
Copy link
Author

These are two FmodListener2D that are in the main scene. Both have set their index to 0 and 1 respectively.

@piiertho
Copy link
Member

And you have set them using editor, right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants