0 votes

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

enter image description here

Is there a way to improve it?

in Engine by (186 points)

2 Answers

0 votes

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?

by (1,039 points)

sorry,i forgeted attach image.

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

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.

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

I don't know where you searched: lerp

0 votes

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

by (14 points)

Should interpolatercamera and target rotation be used with zero rotation?

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

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.