Can I use an interpolated camera with it rotated 180 degrees?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bgegg

I set 3dposition as the camera target.
Does not face the target

enter image description here

Is there a way to improve it?

:bust_in_silhouette: Reply From: BraindeadBZH

Not sure what are you asking for as the title of your post does not really match the text. But have you tried to use look_at?

sorry,i forgeted attach image.
Imgur: The magic of the Internet

If you use an interpolated camera rotated 180 degrees, the operation will be strange.

bgegg | 2019-09-05 20:26

Sorry I did not knew this type of camera existed. From understand this camera also follow the node rotation, which might be the source of the issue. As you try to rotate it manually it might interfere.

If you need a custom behavior for your camera, I suggest to code it yourself as it is not that complex. If you need to smooth (interpolate) the lerp function comes very handy.

BraindeadBZH | 2019-09-05 20:49

Thank you. i try interpolate by script
Godot doesn’t have an lerp function, but I found a slerp function.

bgegg | 2019-09-05 22:40

I don’t know where you searched: lerp

BraindeadBZH | 2019-09-06 10:37

:bust_in_silhouette: Reply From: lazy.ant

I was trying to do the same thing and this is how i did it:

Add a spatial node as a child node to your player, make this spatial node the camera’s target, place the spatial node where the camera needs to be and rotate the spatial node (not the camera) where you want your camera to look at.

" this camera also follows the node rotation" thanks to BraindeadBZH’s answer

Should interpolatercamera and target rotation be used with zero rotation?

bgegg | 2019-09-09 08:46

i dont understand what you are asking, when you assign a target to the camera, target’s rotation becomes camera’s rotation. this only works after you start your game! so dont get confused if it doesnt look like it works in the editor. rotate your target and start the game you will see the difference

lazy.ant | 2019-09-09 19:14

thanks.
Solved by matching the angle of the target and the interpolatedcamera.

bgegg | 2019-09-09 22:01