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

3D Look modes doesn't work #178

Closed P5ina closed 6 months ago

P5ina commented 6 months ago

Issue description

If you set Look at Mode to Mimic or Simple then phantom camera doesn't mimic rotation or look to target. I've discovered why this happens, for some reason _has_look_at_target always false. This is doesn't happens with Group mode.

Steps to reproduce

  1. Create 3D Scene
  2. Create Camera3D
  3. Create PhantomCameraHost as a child of Camera3D
  4. Create PhantomCamera3D
  5. Create Node3D with some rotating script on it
  6. Set Look at Mode to Mimic
  7. Set Look at Target to created Node3D
  8. Run game

(Optional) Minimal reproduction project

No response

WeaselOnaStick commented 6 months ago

Weirdly enough look modes work when previewed in the editor (@tool) but NOT when the scene is actually run

P5ina commented 6 months ago

Why phantom camera properties is so strange? Why don't just use @export and get set for updating properties

ramokz commented 6 months ago

Have pushed a PR (#182), which should fix the issue. Give that a go and see if that works.

Why phantom camera properties is so strange? Why don't just use @export and get set for updating properties

While @export does allow for adding variables to the inspector for a given node, until Godot 4.2, it didn't allow for dynamically hiding properties you didn't need. E.g. you wouldn't want to show all the Group Follow specific properties alongside everything else if you used Simple Follow. _get_property_list(), on the other hand, does allow for that. — link to the docs.

Am currently rewriting the property system to utilize @export with the aforementioned ability introduced in Godot 4.2 (_validate_property()) for v0.7 in #169

P5ina commented 6 months ago

@ramokz That's really nice to hear, thanks for your asset, it's very good!