How to implement "look ahead" when the mode is set to "framed" ? #447
-
I've been through the various discussions regarding the topic of "look ahead" being implemented sometime in the near future -- I really look forward to that and appreciate the work the community has been putting into the plugin! My question is whether there's a workaround to solving the issue until that feature is developed? The very basic issue I'm facing is this: when I update the PhantomCamera2Ds offset with a method like this:
It works perfectly well in modes like simple when damping is implemented to give a smooth camera movement when the player switches direction. When I use framed, the camera no longer adjusts its offset when player changes direction because that's naturally how framed is intended to work, I suppose. What I ideally want here is that when the player changes direction,even when within the deadzone, the frame realigns itself to match the newer position. Is there a way to make this happen? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Do you mean that the framed view changes its position so that it starts moving in the opposite direction without the player having to “touch” the dead zone edge? |
Beta Was this translation helpful? Give feedback.
This would involve a bit of experimentation and manual calculation, but my best suggestion would be to rely on a pseudo follow target.
So rather than using the actual target as a
follow target
you instead use an invisibleNode2D
as thepcam
follow target
. Where you set that pseudo-element's position to be based on the actual target's position, and then apply additional positional changes to that pseudo-element when the actual target's direction / velocity changes.