Closed jrburga closed 2 months ago
For reference, here's a basic setup experimenting with placing the Phantom Cameras inside the CharacterBody, allowing more direct access to things like 3rd person camera rotation from within the player controller code, without having to "@export" or otherwise "find" the Phantom Cameras elsewhere.
Think this is a good idea!
Testing this a bit further, think this would be appropriate for all follow modes.
That said, the treatment for non-Third Person
follow is slightly different, but trivial to add either way. Just need to check the follow mode isn't THIRD_PERSON
on _enter_tree()
function and set it to top_level
there as well.
I am currently working towards v0.7, which effectively changes the entire property system, so would prefer to keep this PR on stand-by until it's merged into the main
branch and then add this in a follow-up release.
With 0.7 now being out, this should just be a case of applying the change to the updated file that is now called phantom_camera_3d
(notice the lowercased ādā at the end) somewhere below line 536
.
Resolved as part #282
Set
_follow_spring_arm_node.top_level = true
when creating it and adding it to the parent node (which is the parent node of the PhantomCamera3D at this point). This allows you to add the PhantomCamera3D to the moving character instance and still have it follow the character without the the spring arm inheriting the character's position. The PhantomCamera3D will be reparanted to the spring arm later on, so the PhantomCamera3D shouldn't be top_level.This is just a slight qol improvement I think that made sense for my use case, but also might be helpful for others trying to do something similar.