Trouble blending between first-person Camera3D and PhantomCamera #517
-
Hi! I'm using the PhantomCamera addon in a first-person project and running into some issues. My setup involves a standard I saw in another thread that you can disable a camera from reacting to PCams by turning off the
Is PhantomCamera not designed with FPS setups in mind? Or is there a recommended way to blend between first-person and PhantomCams? I’m still new to Godot, so apologies if I’m missing something obvious. Any help or direction would be appreciated — thanks! phantomcamissue.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
No, there are no limitations like that, so it must be something that is going awry. This may not be the solution, but worth trying first:
Otherwise, if you can share a MRP, then that would make helping out a lot easier. It's a bit tricky to tell what and how everything is happening. When there are no errors to debug, then it's just educated guesses, but that can quickly become a wild goose chase. |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing all of this, think I can see what is happening now. A rule of thumb when using the addon is, if a scene has a There is a first-person example scene that is probably worth digging into called But to give a quick scene structure and logic reference suggestion, when your code is referring to When you're using a To your question about handling the rotation of the camera when using a # player.gd
func _physics_process(delta):
camera.transform.origin = _headbob(t_bob)
func _headbob(time) -> Vector3:
var pos = Vector3.ZERO
pos.y = sin(time * BOB_FREQ) * BOB_AMP
pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP
return pos The example mentioned at the top demonstrates this as well, but for this specifically, I would suggest checking out the Noise documentation. It essentially applies a noise, be it rotational or positional, to the camera that you can adjust to your liking. Which looks like what you're going for here as well? @onready var host_pcam = PhantomCameraManager.get_phantom_camera_hosts()[0]
# on body entered/exit signals here
func toggle_player_host_layer():
if host_pcam.host_layers == 1:
host_pcam.set_host_layers_value(1, false)
elif host_pcam.host_layers == 0:
host_pcam.set_host_layers_value(1, true) There are some, but very very few cases when you would ever want to disconnect the |
Beta Was this translation helpful? Give feedback.
Thanks for sharing all of this, think I can see what is happening now.
A rule of thumb when using the addon is, if a scene has a
PCam
and aPCamHost
set up, then the camera shouldn't be modified directly. Instead, all modifications should be done on thePCam
, as it transfers its position (akatransform.origin
), and rotation to the camera. This is obviously only the case when you have thehost layers
aligned between thePCam
andPCamHost
.There is a first-person example scene that is probably worth digging into called
3d_noise_example_scene.tscn
insideaddons/phantom_camera/example_scenes/3D(-4.4)
. That should also give a better picture of how to set upCamera
+PCam
+PCamHost
in general.B…