Problems extending PhantomCamera3D #363
-
I'm trying to extend PhantomCamera3D with some extra functionality, mainly the sort of swaying POV kind of motion seen in this video. I made this script that extends PhantomCamera3D:
And I made a new scene called sway_camera that just has a Node3D with the above script attached. This was working well enough for cutscenes (mouse movement to look around when not in cutscenes was causing issues, but that's alright because I only need it for cutscenes). However, I'm trying to animate my custom camera and the normal PhantomCamera3D functionality isn't working as expected. It has a follow mode of glued with a target of some Node3D, and it's look at mode is simple with an initial value of some different Node3D. One second after my extended camera is made active in the cutscene, my animation changes it's look at target to a path follower. Strangely, the initial Node3D look at target is not being looked at. But when the animation changes the target, it correctly points at the path follower. Maybe it's because the initial target is being set in the inspector and the second one is being set by the animation which calls a method to change it with set_look_at_target? I also noticed that the follow offset didn't seem to be working at all. Is there maybe some manual setup I'll have to do in my extended camera script? Maybe PhantomCameraManager isn't picking up on my extended camera when it bootstraps everything (or whatever it does, I haven't looked at that code yet)? EDIT: After playing around with it some more, it looks like it WAS pointing at something with the initial look at target, it was just not pointing in the expected direction. It's like it's off by about 45 degrees on the Y axis. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's worth noting that what it looks like you're trying to add is what is planned in the next release (#126). Beyond that, there are a few things worth mentioning about the setup you shared. Firstly, is the Secondly, and unrelated to the first, are you looking to retain the logic that is happening in the Thirdly, modifying the Honestly, I don't see a simple way of doing what you're looking to do without modifying the addon's source files. Not impossible by any means, but reckon it's not worth the effort given, again, camera noise is planned for the next release. |
Beta Was this translation helpful? Give feedback.
It's worth noting that what it looks like you're trying to add is what is planned in the next release (#126).
So this might become redundant once v0.8 is out.
Beyond that, there are a few things worth mentioning about the setup you shared.
Firstly, is the
PCam3D
logic occurring in the_physics_process
or_process
? The addon will dynamically use one or the other depending on its target(s), and so you too would need to dynamically use one or the other depending on which is being used in thePCam3D
script. At the minute, and ideally, it should be the_process
forPCam3D
in 3D scenes.Secondly, and unrelated to the first, are you looking to retain the logic that is happening in the
_physics_p…