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.93k stars 62 forks source link

Third Person + Look At causes log spam "look_at() failed" although everything works fine #210

Closed stevenctl closed 2 months ago

stevenctl commented 5 months ago

Issue description

Copying the example in the Third Person doc for a mouse controlled third person camera causes the following log to spam:

E 0:00:03:0332   phantom_camera_3D.gd:685 @ _process(): Up vector and direction between node origin and target are aligned, look_at() failed.
  <C++ Error>    Condition "p_up.cross(p_target - p_pos).is_zero_approx()" is true.
  <C++ Source>   scene/3d/node_3d.cpp:935 @ look_at_from_position()
  <Stack Trace>  phantom_camera_3D.gd:685 @ _process()

Everything is functioning fine, despite this log.

I can reproduce this using the tip of main: d4fe530384a2c62966568c50812bfbc3b901ff26 Godot Version is 4.2 stable.

This may be more of a Godot issue than a Phantom Camera issue.

Steps to reproduce

  1. Create a scene with a Camera3D + PhantomCameraHost, a PhantomCamera3D and a target to look at
  2. Copy the script from this doc: https://phantom-camera.dev/follow-modes/third-person#example-setup
  3. Run the project and move the mouse

(Optional) Minimal reproduction project

repro.zip

stevenctl commented 2 months ago

FWIW changing the offset by a tiny amount suppresses this warning with no noticeable effect.

ramokz commented 2 months ago

This should be resolved in the upcoming 0.7 release as it will now no longer use the look_at() method as of #251

ramokz commented 2 months ago

Opened the repo project you shared and updated to the latest release.

Can't see any errors during runtime, which shouldn't happen anyway since, again, look_at() is no longer a thing. Will consider this issue closed, but please don't hesitate to reopen it if you're stilling encountering the issue for whatever reason.