kinsi55 / CS_BeatSaber_Camera2

Adds a lot of options / tools for creating more advanced desktop viewing experiences with multiple camera angles and much more in Beat Saber
MIT License
118 stars 13 forks source link

Attached camera does not behave like a child object #106

Closed headassbtw closed 4 months ago

headassbtw commented 9 months ago

When attached to a GameObject, cameras do not behave as if they are children of the target object.

So if you:

the camera's rotation copies the parent's rotation, instead of behaving like a child

here's an example: the middle camera is a "base" camera, with the same transforms as the problematic one, but without being attached bottom left is attached to the player/avatar (LocalPlayerGameCore) bottom right is showing that the avatar is rotated

image

side note; from what i can tell, this is more of an implementation side effect than a bug, however this is a long-standing issue i've had with this mod

kinsi55 commented 9 months ago

It doesnt behave like it is, because it isnt. The final position of a Cam2 camera is not achieved in a super straight forward fashion

The offset you configure in Cam2 is applied after the "base position" (i.e., head, attached target)

https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/9b596886e45620f3b84520bad5e68274649e91cf/Behaviours/Cam.cs#L135

https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/9b596886e45620f3b84520bad5e68274649e91cf/Middlewares/Smoothfollow.cs#L120-L121

https://github.com/kinsi55/CS_BeatSaber_Camera2/blob/9b596886e45620f3b84520bad5e68274649e91cf/Utils/TransformChain.cs#L6-L12

As for changing that behaviour: Thats probably not gonna happen. If you can come up with a better system that achieves all the same things as Cam2 currently does I will gladly take it, but this complicated mess is the best I could come up with.

headassbtw commented 9 months ago

figured