Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

fix: camera jitter in moving platforms #1327

Merged
merged 7 commits into from
Sep 28, 2020

Conversation

pravusjif
Copy link
Member

@pravusjif pravusjif commented Sep 17, 2020

WHY?
right now the third person camera tries to accomodate its vertical position always and that gets clunky when the character is on a vertical moving platform, leading to a bad UX

WHAT?
We are disabling the camera positioning auto-damping when the chara is on a moving platform and resetting those values when he gets out of the moving platform

TESTING
You can test this in Genesis Plaza's air balloon moving platform, specially when moving up/down and having the camera pointing down to the character (instead of having the camera at the character-level or below), by comparing the camera jittering/stuttering in prod and in this branch:

prod: http://play.decentraland.org/
this branch: https://explorer.decentraland.zone/branch/fix/CameraJitterInMovingPlatforms/index.html?ENV=org

@pravusjif pravusjif added the wip Work in progress label Sep 17, 2020
@pravusjif pravusjif self-assigned this Sep 17, 2020
@github-actions
Copy link

@pravusjif pravusjif added ready for review and removed wip Work in progress labels Sep 22, 2020
Copy link
Contributor

@sandrade-dcl sandrade-dcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed and tested. The UX now is much better!

entity.components.Add(classId, null);

lerpController = entity.gameObject.AddComponent<TransformLerpController>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution: enabling lerping for all the transforms will cause a lot of unwanted behaviour. We should at least enable this only on transforms that we are landed to. Remember the air balloon is animation based, this could break other system-based movements.

Copy link
Member Author

@pravusjif pravusjif Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the TransformLerpController is doing nothing different than the behaviour we already had, because we are not using its lerpingSpeed.

I just left that component there so that when we introduce transform lerping we could just start using that speed property (be it by calculating the speed before or reading it from a property of the SDK component model), and we could also add a different lerping speed for rotation and scaling.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the TransformLerpController usage

@pravusjif pravusjif merged commit e4d8552 into master Sep 28, 2020
@pravusjif pravusjif deleted the fix/CameraJitterInMovingPlatforms branch September 28, 2020 21:39
This was referenced Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants