Skip to content

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

@soomr

Description

@soomr

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+

Metadata

Metadata

Assignees

No one assigned

    Labels

    3DIssues concerning 3D scenesbugSomething isn't workingphantom cameraRelated to PhantomCamera nodes

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions