-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fixed jitter for none physics object #179
Conversation
Hello! I want to point out that this change makes huge difference, however spring arm is still causing a bit of jitter when camera is up against the wall. I am more than happy to implement spring arm smoothing once this PR is merged. |
@Lasuch69 Thanks for pointing this out, I will investigate into this. I think I know how to fix this. |
This PR does seem to solve both your point of jittery animations happening in the This current solve does also mean that the requirement of the |
@ramokz I think, we can make a switch to be able to use both |
I think I know how to fix this. We can make a smoothing inside the camera script, like it's done in smoothing addon. I'll implement this. |
I don't think that we should care about if target is smoothed or not, as it isn't really the responsibility of the camera. If you want to fix jitter you need to smooth the target anyway. I would suggest making smoothing just for the spring arm and animation in the We would end up with double smoothing, which might introduce "lag". Edit: Another way it could be done is to make camera smoothing optional. |
Inclined to agree that it's fair to expect the developer to be responsible for keeping visual representation of nodes smoothed when they're nested within a physics based node, given it's a known issue and should have a better built-in solution eventually. From reading, Godot The one thing I do want to avoid is the experience friction point when people update the addon to then suddenly start seeing jitter that wasn't present before. For some, the solution would require them to add either an additional add-on, or add a few lines of code themselves — not a big deal in of itself, but will likely be confusing for people who don't know. For that reason, I would prefer this change being merged as part of the |
Thanks for bringing up the discussion and submitting this PR 💯 |
* Update README.md * Added a checker for PCam Host when a PCam exits the scene (#175) * Fixed jitter for none physics object --------- Co-authored-by: Marcus Skov <Hello@MarcusSkov.com>
* Added instance validator on _exit_tree() * First pass for 3D _validate_property() * Added additional 3D properties * Fixed jitter for none physics object (#179) * Update README.md * Added a checker for PCam Host when a PCam exits the scene (#175) * Fixed jitter for none physics object --------- Co-authored-by: Marcus Skov <Hello@MarcusSkov.com> * Updated CharacterControllers to support changed camera movement interpolation. * Removed unneeded interpolation from phantom_camera_3D.gd * Updated viewfinder.gd * Minor property reference updates * Updated phantom_camera_3D.gd and phantom_camera_2D.gd * Updated plugin.cfg to 0.7 * Updated more properties and example scenes * Fixed issue with grabbing active_pcam in viewfinder.gd * Minor updates * 171 third person quaternion (#190) * Updated CharacterControllers to support changed camera movement interpolation. * Removed unneeded interpolation from phantom_camera_3D.gd * Added quaternion setter/getter for Third Person Follow * Embedded enums to PCam3D script directly * Added additional doc comments * Updated 3D example scenes * Merged #191 into 0.7 * (Re)added draw limits variable to PCam2D * Updated script documentation * Added more properties and signals to PCam scripts - [Removed] Remaining constant. variable uses - [Added] dead_zone_changed signal - [Added] PhantomCameraHost variable to PCam scripts directly - [Updated] viewfinder.gd with the dead_zone_changed signal change - [Updated] pcam active setter in PCamHost using setter method * Added enums directly to tween_resource.gd - [Added] GDScript descriptions to tween resource properties * Changed assign_pcam_host to set_pcam_host * Updated .import files * Readded Host to Third Person Example scene * Updated example scenes * Fixed issue with Limit Margin not updating correctly * Updated Tween Resource enum names to align with Tween class * Removed phantom_camera_properties.gd * Swapped yaw and pitch variable names * Removed group_names.gd - [Moved] group_names.gd constants to phantom_camera_constants.gd * Updated example scenes * Added Cull Mask Helper Function - [Added] Setter / Getter for SpringArm3D shape and margin - [Renamed] Camera3DResource setter/getter names * Changed reset_limit_all_sides() to reset_limit() * Removed _camera_3D_resouce_default and tween_resource_default - [Renamed] spring_arm setters/getters - [Added] set_collision_mask_value helper function - [Added] Missing setters/getters * Fixed UI in 2D example scene * Removed tween_resource_default from PCam2D * Updated example scenes * Fixed issue with limit not working after a tween * Updated PCam Host setter/getter * Privitised has_tweened and has_multiple_follow_targets * Renamed pixel_perfect to snap_to_pixel * Added look_at_target_changed signal * Updated many script documentation comments * Added missing default values to phantom_camera scripts * Added comments and privatised variables and functions in phantom_camera_host.gd * Added documentation and editor icon for tween_resource.gd * Added documentation for camera_3D_resource.gd * Fixed issue when assigning empty target(s) on editor start * Updated editor icons and removed unused * Viewfinder 2d (#220) * Initial working 2D viewfinder * Updated gizmo icon - [Removed] Old Gizmo icon(s) - [Updated] viewfinder_panel.tscn with improved icon sizing layout * Improved 2D viewfinder - [Renamed] Lowercased ...2D and ...3D to 2d/3d in various variable names * Improved aspect ratio scaler * Improved viewfinder logic checker * Removed commented out logic * CleanED up viewfinder file - [Removed] editor_interface variables and replaced with singleton Class ref - [Removed] Unneeded conditional checker and logic * Simplified scene change signal function * Solved error with viewfinder Now no longer being referenced from export builds * Updated example scenes * Added missing PCamHost to 2DExampleScene.tscn * Fixed issue where various setters for _follow_spring_arm didn't get applied at runtime * Added 2d rotation tween support * Fixed issue with stacking viewfinder Occured if you changed from one PCam to another that both used Framed Follow * Cherry picked changes from main branch * Added instance validator on _exit_tree() * First pass for 3D _validate_property() * Added additional 3D properties * Fixed jitter for none physics object (#179) * Update README.md * Added a checker for PCam Host when a PCam exits the scene (#175) * Fixed jitter for none physics object --------- Co-authored-by: Marcus Skov <Hello@MarcusSkov.com> * Updated viewfinder.gd * Minor property reference updates * Updated phantom_camera_3D.gd and phantom_camera_2D.gd * Updated plugin.cfg to 0.7 * Updated more properties and example scenes * Minor updates * Updated CharacterControllers to support changed camera movement interpolation. * Removed unneeded interpolation from phantom_camera_3D.gd * 171 third person quaternion (#190) * Updated CharacterControllers to support changed camera movement interpolation. * Removed unneeded interpolation from phantom_camera_3D.gd * Added quaternion setter/getter for Third Person Follow * Embedded enums to PCam3D script directly * Added additional doc comments * Updated 3D example scenes * Merged #191 into 0.7 * (Re)added draw limits variable to PCam2D * Updated script documentation * Added more properties and signals to PCam scripts - [Removed] Remaining constant. variable uses - [Added] dead_zone_changed signal - [Added] PhantomCameraHost variable to PCam scripts directly - [Updated] viewfinder.gd with the dead_zone_changed signal change - [Updated] pcam active setter in PCamHost using setter method * Added enums directly to tween_resource.gd - [Added] GDScript descriptions to tween resource properties * Changed assign_pcam_host to set_pcam_host * Readded Host to Third Person Example scene * Updated example scenes * Fixed issue with Limit Margin not updating correctly * Updated Tween Resource enum names to align with Tween class * Removed phantom_camera_properties.gd * Swapped yaw and pitch variable names * Removed group_names.gd - [Moved] group_names.gd constants to phantom_camera_constants.gd * Updated example scenes * Added Cull Mask Helper Function - [Added] Setter / Getter for SpringArm3D shape and margin - [Renamed] Camera3DResource setter/getter names * Changed reset_limit_all_sides() to reset_limit() * Removed _camera_3D_resouce_default and tween_resource_default - [Renamed] spring_arm setters/getters - [Added] set_collision_mask_value helper function - [Added] Missing setters/getters * Fixed UI in 2D example scene * Removed tween_resource_default from PCam2D * Updated example scenes * Fixed issue with limit not working after a tween * Updated PCam Host setter/getter * Privitised has_tweened and has_multiple_follow_targets * Renamed pixel_perfect to snap_to_pixel * Added look_at_target_changed signal * Updated many script documentation comments * Added missing default values to phantom_camera scripts * Added comments and privatised variables and functions in phantom_camera_host.gd * Added documentation and editor icon for tween_resource.gd * Added documentation for camera_3D_resource.gd * Fixed issue when assigning empty target(s) on editor start * Updated editor icons and removed unused * Viewfinder 2d (#220) * Initial working 2D viewfinder * Updated gizmo icon - [Removed] Old Gizmo icon(s) - [Updated] viewfinder_panel.tscn with improved icon sizing layout * Improved 2D viewfinder - [Renamed] Lowercased ...2D and ...3D to 2d/3d in various variable names * Improved aspect ratio scaler * Improved viewfinder logic checker * Removed commented out logic * CleanED up viewfinder file - [Removed] editor_interface variables and replaced with singleton Class ref - [Removed] Unneeded conditional checker and logic * Simplified scene change signal function * Solved error with viewfinder Now no longer being referenced from export builds * Updated example scenes * Added missing PCamHost to 2DExampleScene.tscn * Fixed issue where various setters for _follow_spring_arm didn't get applied at runtime * Added 2d rotation tween support * Fixed issue with stacking viewfinder Occured if you changed from one PCam to another that both used Framed Follow * Cherry picked changes from main branch * Damping 2.0 (#248) * Smooth damp for phantom_camera_3D.gd * Minor 3D damping updates * Added Smooth Damp to phantom_camera_2D.gd - [Updated] Minor things for 3D smooth damp system * Re-added physics interpolation to 2D script * Removed Smoothing nodes and improved 2d documentation * Rotate damping (#251) * Fixed incorrect name and added type to variable * Fixed issue with look_at method not being called * Added Look At Damping properties * Changed _set_velocity to _set_follow_velocity * Added Look At damping * Updated damping default values * Added conditional look_at_damping * Added damping to LookAt Group * Minor property updater fixes * Removed unneeded variable * Added range slider to Look At Damping * Added additional look_at checks * smooth_damp function parameter alignment * Minor Group Look At fix * Removed unused variables * Corrected fixed camera angle tween duration * Fixed issue with tweening 2D zoom * Made player model be set to top level * Made playable_character_2d.tscn its own scene * Updated default 2D follow_damping_value * Added playable_character_3d * Updated remaining example scenes and scripts * Updated room limit script * Updated dev_scene_3d * Renamed 2d_trigger_area * Fixed tween issue in 3DExampleScene.tscn * Removed documentation comment from _is_active * Updated tween_onload to tween_on_load * Updated examples scenes with tween_on_load rename * Minor CharacterController changes * Whitespace removal * Renamed core scripts [Renamed] phantom_camera_2D.gd to phantom_camera_2d.gd [Renamed] phantom_camera_3D.gd to phantom_camera_3d.gd * Renamed camera_3D_resource - [Renamed] Renamed camera_3D_resource to camera_3d_resource.gd * Renamed UpdateButton.tscn - [Renamed] UpdateButton.tscn to update_button.tscn * Renamed phantom_camera_gizmo_plugin_3D.gd - [Renamed] phantom_camera_gizmo_plugin_3D.gd to phantom_camera_gizmo_plugin_3d.gd * Renamed CustomGizmo.gd - [Renamed] CustomGizmo.gd to custom_gizmo.gd * Renamed example scenes to use snake_case * Renamed image assets and remaining scenes --------- Co-authored-by: Timur Turatbekov <44378225+P5ina@users.noreply.github.com> Co-authored-by: ZenithStar <zenithstar@users.noreply.github.com>
Camera is not a physics body, it should be animated in
_process
. There is example of my fix:Before
plugin_showcase.mp4
After
plugin_showcase_patch.mp4
The cube is animated through tweens, but they're working in
_process
. Script example: