Closed ramokz closed 5 months ago
There are a few ways I can think of resolving this issue, but none of them seem lead to a perfect solution.
From the issue video example above, if you make damping apply to the camera's local positioning, then that resolves the issue when moving in the x-axis.
But conversely, if the camera is slightly tilted to point downwards, like above, then that would mean the y and z-axis damping is now pointing in a local forward and upward axis, which might not be desired either.
Current thinking is to allow the user to set which axis should be local, be it individual axis (e.g. x only) or multiple (e.g. xz only). Though it still feels like it doesn't solve all situations.
What's an application where you would want to have independent dampening magnitudes per axis? The only one I can think of is maybe have higher dampening on the vertical axis in order to accentuate the feeling of falling, but I don't think it works like that.
Video with dampening (0.1, 1.0, 0.1): 2024-04-27 06-30-19.webm
Versus what I'd normally would want (0.1, 0.1, 0.1): 2024-04-27 06-37-34.webm
Can imagine a few instances where that might be desired, but, obviously, it's entirely dependent on what direction a dev wants for their camera.
@trevorstarick suggested it a little while ago (#255), after it had already been implemented in the 0.7 branch, so maybe there's a particular use-case?
I was originally looking for a way to limit the aggressive-ness of the x-axis follow for a platformer I'm working on.
Does the current implementation match what you were looking for, or are there any changes you miss?
Yup, it's pretty much the same implementation that I had. I'm still messing around with the core camera design, so if there is anything that I'm missing, I'll probably end up forking and then making a PR for any features I add/extend.
Nice!
Will close the issue for now as no one has complained about it yet, but anticipate someone will down the line.
Issue description
For 3D scenes
When enabling
Follow Damping
and supplying different values, e.g.Vector3(0.1, 0.1, 0.6)
, in theFollow Damping Value
property, the damping movement doesn't update the camera's local position consistent once the camera starts moving.Steps to reproduce
PCam3D
setup with a movable characterPCam3D
follow target to the movable characterFollow Damping Value
withVector3(0, 0, 0.6)
PCam3D
is sitting diagonally or sideways from its follow targetPCam3D
's rotation so it points towards its target againBoth examples below has:
Follow Damping Value
=Vector3(0, 0, 0.6)
Normal Version
Follow Offset
=Vector3(0, 2, -2)
https://github.com/ramokz/phantom-camera/assets/5159399/c1d74fdb-cde8-459c-8f9b-97bce030fb27
Issue Version
Follow Offset
=Vector3(-2, 2, 0)
https://github.com/ramokz/phantom-camera/assets/5159399/b30edd46-5008-4cd9-969a-7bff6896e45d
As seen, the damping is following the global coordinates rather than its local x, y, z positions, which makes the damping value a bit misleading and, likely, not lead to the intended experience.
(Optional) Minimal reproduction project
No response