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

Vessel effects audio have a pos/rot offset in KSP 1.12 #42

Closed
gotmachine opened this issue Jun 8, 2022 · 0 comments
Closed

Vessel effects audio have a pos/rot offset in KSP 1.12 #42

gotmachine opened this issue Jun 8, 2022 · 0 comments
Labels
kspBug Identified KSP issue

Comments

@gotmachine
Copy link
Contributor

This causes random audio loss and L/R channel weirdness.

Issue uncovered by @ensou04
See forum post

The issue seems to be in the FlightCamera.EnableCamera() and FlightCamera.DisableCamera() methods.

They are re-parenting the AudioListenerGameObject using the Transform.SetParent(Transform parent) overload that set the worldPositionStays parameter to true, which will induce a local position/rotation offset when reparenting.

Patching those methods to use the Transform.SetParent(Transform parent, bool worldPositionStays) overload with that last parameter set to false should prevent any offset to ever be introduced.

Test build with a fix :
KSPCommunityFixes_1.15.0_PRERELEASE.zip

@gotmachine gotmachine added the kspBug Identified KSP issue label Jun 8, 2022
gotmachine added a commit that referenced this issue Jun 8, 2022
…ned with the current vessel after scene switches, causing loss of vessel effects audio and random volume or left/right channel weirdness.

Thanks to @ensou04 for uncovering the cause of this bug.
gotmachine added a commit that referenced this issue Jan 30, 2023
…ned with the current vessel after scene switches, causing loss of vessel effects audio and random volume or left/right channel weirdness.

Thanks to @ensou04 for uncovering the cause of this bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kspBug Identified KSP issue
Development

No branches or pull requests

1 participant