Replace custom camera behavior with Phantom Camera for hooking#2227
Replace custom camera behavior with Phantom Camera for hooking#2227manuq wants to merge 7 commits into
Conversation
|
Play this branch at https://play.threadbare.game/branches/endlessm/camera-when-hooking/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
eee6c59 to
f651688
Compare
|
The main issue I'm finding is: I added a PhantomCamera2D to each scene for following the player, instead of one to the player scene, because of the camera limits. But when switching to the PhantomCamera2D at the tip of the string (in PlayerHook), it doesn't have those limits so the undecorated world appears. This is noticeable, for example, in the tutorial grapping: Grabacion.de.pantalla.desde.2026-05-19.22-15-40.mp4Also, something I need to fix: when grabbing the longer thread we tween the camera zoom to zoom out, and that has to be done with Phantom Camera now. |
|
We could simply declare that the level designer needs to dress enough of the level around each hook point :) |
Most scenes that had the grappling hook ability active, had this node as child of the camera for controlling it. With the target set to the HookEnding marker of PlayerHook in player. This will be in favour of using Phanton Camera in next commit.
Set follow mode to Framed and set dead zone to 0.5 width and height. Also enable follow dumping. Otherwise the transitions between cameras is smooth, but the transition when the tip of the string changes to another needle or other hookable object isn't. And change its priority to: - Zero when the camera is not supposed to follow the tip - 20 when the camera should follow the tip
In scenes: - tutorial_grappling.tscn - grappling_hook_needles.tscn - grappling_hook_powerup.tscn - void_grappling.tscn - void_grappling_round_2.tscn Add the PhantomCameraHost node to the Camera2D in order to control it. Add a PhantomCamera2D node to the scene as well, copying the same limits from the Camera2D. Set priority to 10, so it will be active when the one at the tip of the string isn't. Set follow target to the Player node. Also enable follow damping which is similar to the previous position smoothing of Camera2D.
Use the Void TileMapLayer in each scene as the limit target of the PhantomCamera2D node. Paint the tilemap to match the existing limit. In the cases in which the void tiles were used to block the player going out of the camera/world bounderies, use water instead. PlayerHook: Add a function to use the same limit target for the camera that's at the tip of the string.
aa03657 to
84a710d
Compare
|
I fixed the above. I also fixed the zoom out when grabbing the longer thread in the 2 scenes that have it. I did it by zooming out each PhantomCamera2D. This goes a bit against what's indended in the addon, which I guess will have a second already zoomed-out PhantomCamera2D, and alternate between them by priority. But in that case we'll need 2 zoomed out versions, one for the camera following the player and one for the one at the end of the tip. So I'm not sure... should I do that instead? |

Grappling hook scenes: use Phantom Camera
In scenes:
Add the PhantomCameraHost node to the Camera2D in order to control it.
Add a PhantomCamera2D node to the scene as well. Set priority to 10, so it will be active when the one at the tip
of the string isn't. Set follow target to the Player node. Also enable follow
damping which is similar to the previous position smoothing of Camera2D.
Use the Void TileMapLayer in each scene (except one) as the limit target of the
PhantomCamera2D node. Paint the tilemap to match the existing limit. In the
cases in which the void tiles were used to block the player going out of the
camera/world bounderies, use water instead.
Zoom out each PhantomCamera2D when grabbing the longer thread powerup.
PlayerHook: Add PhantomCamera2D at the tip of the string
Set follow mode to Framed and set dead zone to 0.5 width and height. Also enable
follow dumping. Otherwise the transitions between cameras is smooth, but the
transition when the tip of the string changes to another needle or other
hookable object isn't.
And change its priority to:
Add a function to use the same limit target for the camera that's at
the tip of the string.
Remove FrameCameraBehavior node
Most scenes that had the grappling hook ability active, had this node as child
of the camera for controlling it. With the target set to the HookEnding marker
of PlayerHook in player.
This will be in favour of using Phanton Camera in next commit.