ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
1.97k stars 65 forks source link

Add a `follow_target_changed` signal #192

Closed ZenithStar closed 6 months ago

ZenithStar commented 6 months ago

Project Type

3D

Feature Description

Automatically emit a follow_target_changed signal when follow_target is changed

Use Cases

So that dependent component nodes can know when to update

Importance

High - there are critical things I can't do without this feature

Usage

All the time - the feature can be very useful for a varity of different projects

(Optional) Proposed Solution

191

ZenithStar commented 6 months ago

A little more explanation about my motivations for this change: Previously, I used a child node to add_user_signal("follow_target_changed") and hold a target property which emitted the signal, so to change targets, I would need to pcam.find_child("Target").target = new_target rather than pcam.set_follow_target_node(new_target). I just recently discovered that you can't actually change follow modes on a pcam, and so now I also need to arbitrate between several different pcams in different follow modes, which makes that set_target call several nodes deep and would've been very annoying.

ramokz commented 6 months ago

Good proposal! All sounds sensible to me.