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.29k stars 77 forks source link

Mimic look at mode stopped working after v0.8 #422

Open ShadowFungi opened 3 days ago

ShadowFungi commented 3 days ago

Issue description

Setting a PhantomCamera3D's look at mode to mimic does not mimic the object it is looking at.

Steps to reproduce

  1. add base nodes for phantom camera 3D setup
  2. set PhantomCamera3D's look at mode to mimic
  3. set PhantomCamera3D's look at object to a sibling(?) of the camera 3D
  4. rotate the object that is supposed to be mimiced

(Optional) Minimal reproduction project

Mimic-min-repro-v0.8.zip Mimic-min-repro-v0.7.3.zip

ramokz commented 1 day ago

Good catch! Was a simple oversight for that particular Look At mode; will be fixed in the next release.

If you urgently need a fix for it, then you can just change the line on 892 to the following in phantom_camera_3d.gd:

## Before
## LookAtMode.MIMIC:
##  global_rotation = look_at_target.global_rotation

## After 
LookAtMode.MIMIC:
  _transform_output.basis = look_at_target.global_basis
  global_basis = look_at_target.global_basis