Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third Person Camera Setup is offset from follow target in global +z direction, regardless of initial rotation #463

Open
soomr opened this issue Feb 15, 2025 · 0 comments

Comments

@soomr
Copy link

soomr commented Feb 15, 2025

Issue description

Since the follow_offset uses global space, if one rotate their camera setup so that do not start in the z direction , the camera is offset to global z direction, resulting the camera always starting in the global +z when the expected behavior would be that it would be the player's local +z.
Maybe I am missing something here, but in the current build I cannot find a way to find have the camera starting in a different direction.

I tried to fix this by changing the _get_target_position_offset() to have the follow offset multiplied by the follow_target.global_transform basis before being added to the follow_target.global_position but I dont know if this properly addresses the issue. With this fix, I also had to change how the cameras tween'd because for some reason that also got messed up
Image

Steps to reproduce

  1. Create a node3d
  2. Make main camera (& phantomcamera host) child of node3d
  3. Make phantomcamera3d node as child of node3d
  4. Set it to follow the player node and third person
  5. Rotate node3d

(Optional) Minimal reproduction project

You can see this on res://addons/phantom_camera/examples/example_scenes/3D/3d_follow_third_person_attribtues_example_scene.tscn
1.reparent the main camera and the playermesh to a new node
2. rotate that new node.
3. The camera starts offset from the mesh in the global +z as opposed to local z+

@soomr soomr changed the title Third Person Camera Setup does not allow the player to start the scene rotated Third Person Camera Setup is offset from follow target in global +z direction, regardless of initial rotation Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant