Godot 4.3
I can’t get my camera to follow my character loosely i currently have it in a temporary fixed position and i need the camera to face the same direction the entire time
What does your scene tree look like?
I personally like to have my scene tree, depending on the current requirements, to look somewhat like:
ActorContainer
- CameraPivot
- Camera
- CharacterBody
- RemoteTransformForCameraPivot
Where you can constrain what remote transform syncs with pivot.
You can add multiple levels of pivots if desired. You lerp camera to a certain distance away from pivot.
I have my character in its own scene so my scene tree is:
Characterbody3D
- Camera3D
- CollisionShape3D
-MeshInstance3D
If you want it to not phase through objects do this:
otherwise, just make a node3d and attach the camera to it.
I was thinking of movement delay so when I make a sudden movement the camera won’t
Sounds to me like you just want to lerp the position of the camera to the player position, which will give you that smooth lose camera feel probably.
not gonna lie i have no idea what that is
So you would do something like camera.position = lerp(camera.position, new_position, 0.1 * delta), the last value determines how quickly it will get to the new position.
“lerp” is short for “linear interpolation” or “linearly interpolate”. There’s a lerp()
function in the globals that will do it.
Thanks i did some research and i now know how to use the lerp function
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.