-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Implement Smoothing Speed Control for Individual Axes in Camera2D #95717
base: master
Are you sure you want to change the base?
Implement Smoothing Speed Control for Individual Axes in Camera2D #95717
Conversation
Removing a property (or renaming it) breaks compatibility with existing projects, so you must add two new properties and deprecate the old one instead. The old property can be hidden from the inspector if the value is equal to its default (define |
This recent commit restored the value and should fix any compatibility errors. |
platform/macos/SCsub
Outdated
@@ -26,7 +26,9 @@ def generate_bundle(target, source, env): | |||
target_bin = lipo(bin_dir + "/" + prefix, env.extra_suffix + env.module_version_string) | |||
|
|||
# Assemble .app bundle and update version info. | |||
app_dir = Dir("#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app").abspath | |||
app_dir = Dir( | |||
"#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an entirely unrelated style change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's strange since I didn't edit that file at all. I'm guessing pre-commit might have made some automatic edits. Should I change it back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-commit automatically changes it and I don't think I can bypass it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
platform/macos/SCsub
Outdated
@@ -26,7 +26,9 @@ def generate_bundle(target, source, env): | |||
target_bin = lipo(bin_dir + "/" + prefix, env.extra_suffix + env.module_version_string) | |||
|
|||
# Assemble .app bundle and update version info. | |||
app_dir = Dir("#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app").abspath | |||
app_dir = Dir( | |||
"#bin/" + (prefix + env.extra_suffix + env.module_version_string).replace(".", "_") + ".app" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Please apply suggestions as a batch to avoid excessive commits |
Ah, I didn't know you could do that. Yes I will do that in the future. |
The user can now control the smoothing speed for the X and Y axes individually for smoothing in the Camera2D node, as opposed to only being able to control them together previously. This was done by removing the previous position_smoothing_speed property and replacing it with two new properties: position_smoothing_horizontal_speed and position_smoothing_vertical speed. The smoothing calculation was altered to use these two values.
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
b56e5c2
to
4cb926c
Compare
Sorry, that was my fault I was just trying to update my branch. Do you know if/when my PR can be approved? |
It needs feedback from the appropriate team, they have been requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is fine, if there was any doubt.
I can personally see the benefit, although it's a bit niche.
For more complex behaviours, writing your own code is not just necessary but encouraged.
"Rotation smoothing was accepted, so why not this?". I suppose one must argue where to draw the line.
The user can now control the position smoothing speed for the X and Y axes individually for smoothing in the Camera2D node, as opposed to only being able to control them together previously.
This was done by removing the previous position_smoothing_speed property and replacing it with two new properties: position_smoothing_horizontal_speed and position_smoothing_vertical speed. The smoothing calculation was altered to use these two values.
Here is what the new values in the editor look like.

Here's a video showcasing differing smoothing speeds on the axes.
Screen.Recording.2024-08-17.154200.mp4
I have verified that this works with limit smoothing as well.