Lifecycle functions around the rendering? #3762
D8H
started this conversation in
Enhancement ideas (and their technical discussions)
Replies: 1 comment 3 replies
-
I understand the problem, but I don't understand how your suggested solution would work. Can you explain it more? One idea to work around this might be for the game developer to add a "Camera is NOT shaking" condition on the "Follow player" action. However, this could also look bad as the player could move out of the screen during the shake. Any other ideas? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Camera extension conflicts
The screen shake extension conflicts with other extensions that moves the camera like the smooth camera following.
Current shaking implementation
It seems that the screen shake extension keeps track of of the sum of displacement applied to the camera to put it back where it should be after when the shaking ends.
The issue is that the events or other extensions see the impact of shaking on the camera position. An action to follow an object will greatly reduce the shaking by trying to put back the camera on the object.
Another broken solution with preEvent
The shaking displacement could be reverted in
preEvent
this works well to avoid conflict with scene events. But as another extensionpreEvent
can be called before the shaking one, it would revert the changes done by this other extension.Lifecycle functions around the rendering
The only solution I see to solve this conflict is to add new life-cycle functions around the rendering. It will allows to revert the camera position after the rending.
I don't see a lot of other use-case for it, but there could be position rounding on specific object for instance. Maybe it can be a new callback that can only be used with JavaScript.
Beta Was this translation helpful? Give feedback.
All reactions