On the stable branch (1.5.4) the functions AttachCameraTo and SetCameraOffsetTransform modify the placement of the player's held tool as well as the camera. This is not the case on the experimental branch (1.6.0). While I think this may have been on purpose, the changes do break something I was working on, so here I am.
Steps to reproduce the behavior
Make a global mod and put this in its main file:
function tick(dt)
-- Tools will remain with the camera in 1.5.4 (what is wanted),
-- and they will remain with the player's body in 1.6.0 (what is not wanted).
--AttachCameraTo(GetWorldBody())
SetCameraOffsetTransform(Transform(Vec(0, 0, 4)), true)
end
Enable the mod and load a map on the stable branch.
Do the same on the experimental branch.
Expected behavior
I'd expect the tool to move with camera, but it doesn't on the experimental branch. Note that while SetCameraOffsetTransform doesn't change the tool's position, SetPlayerCameraOffsetTransform does. I'm guessing this is on purpose, however I wouldn't be able to use it for my project as I still use AttachCameraTo to stop the player's automatic height adjustment from messing with the camera. See below for what might be a better solution.
Environment
Teardown Version 1.6.0 (Experimental)
OS: Ubuntu (more or less) with Teardown running under proton.
GPU: RTX 3060
Graphics driver version: 535.otherdigits
CPU: Intel something or other, doesn't really matter for this bug.
Additional context
Possible alternative/better solution:
A SetPlayerHeight function in the API to forcefully set the player's height for that frame. It would allow me to work around the issue in my specific use case, while also still making sense and being useful to other people.
Here are also some videos I recorded to better demonstrate the behaviour I've been experiencing.
Describe the bug
On the stable branch (1.5.4) the functions
AttachCameraTo
andSetCameraOffsetTransform
modify the placement of the player's held tool as well as the camera. This is not the case on the experimental branch (1.6.0). While I think this may have been on purpose, the changes do break something I was working on, so here I am.Steps to reproduce the behavior
Expected behavior
I'd expect the tool to move with camera, but it doesn't on the experimental branch. Note that while
SetCameraOffsetTransform
doesn't change the tool's position,SetPlayerCameraOffsetTransform
does. I'm guessing this is on purpose, however I wouldn't be able to use it for my project as I still use AttachCameraTo to stop the player's automatic height adjustment from messing with the camera. See below for what might be a better solution.Environment
Additional context
Possible alternative/better solution:
A
SetPlayerHeight
function in the API to forcefully set the player's height for that frame. It would allow me to work around the issue in my specific use case, while also still making sense and being useful to other people.Here are also some videos I recorded to better demonstrate the behaviour I've been experiencing.
Stable Branch: https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/136792894/52bf47dd-8b6e-423c-a7e6-cda1e521e6c2
Experimental Branch: https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/136792894/c02a60cb-42c8-4e27-8a2b-067f2c907d2b