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
2.18k stars 72 forks source link

Support "Multiple Instances" #140

Closed warent closed 9 months ago

warent commented 10 months ago

Project Type

3D

Feature Description

I'm not sure if this is a bug or a feature request. Whenever I start with multiple instances (i.e. under Godot Debug settings), one of the Cameras seems to lose its "Follow Parameters". I haven't looked too deeply into this but can only assume it has something to do with a singleton pattern

https://github.com/ramokz/phantom-camera/assets/13342266/7462fa47-8686-450c-b36a-dc670d2c94a9

Use Cases

As the title and description explain, allows support for Godot multi-instance

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

No response

ramokz commented 10 months ago

That is very odd.

I tried running 3 instances of the 3DFollowFramedExampleScene.tscn, but each instance didn't seem to replicate the issue with losing their follow parameters when running the scene.

Are you applying any of the properties via code, or is it all done from the inspector?

Sample video

https://github.com/ramokz/phantom-camera/assets/5159399/054001c4-5719-43b6-a582-e099263f4dfe

ramokz commented 10 months ago

I just spotted you're using a PCam in a Framed Follow mode, which might be the same issue as in #143.

Try replacing your PhantomCamera3D.gd with the version attached below and see if that solves it: phantom_camera_3D.gd.zip

warent commented 10 months ago

Hey there, thanks for the followup. I think this is actually a bug with Framed cameras sometimes not initializing their offset. I've submitted a PR to fix https://github.com/ramokz/phantom-camera/pull/147

ramokz commented 9 months ago

Closing as issue has been resolved in #147