You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a PCam with follow_mode as ThirdPerson, I wrote this code expecting the camera to rotate around the target (which is the character object), but instead, this method is actually rotating the camera around its own Y.
const SPEED = 5
func _input(event):
if event is InputEventMouseMotion:
var x = event.relative.x * 0.001 * SPEED
var old_rotation = %PCamThirdPerson.get_third_person_rotation()
var new_rotation = Vector3(
old_rotation.x,
old_rotation.y + x,
old_rotation.z
)
%PCamThirdPerson.set_third_person_rotation(new_rotation)
Steps to reproduce
Add a CharacterBody3D, Camera3D, PCamHost and PCam to the scene, plus some ground with respective collisions
Set PCam with:
a. Priority = 0
b. Follow Mode = Third Person
c. Follow Target = CharacterBody3D
d. Follow Offset = (0, 10, 10)
e. Spring Length = 10
f. Create a script and add the code I wrote above
g. Run
(Optional) Minimal reproduction project
Additionally, if I set Look at Mode to Siple and Look at Target to CharacterBody3D (in face any other object), the camera will as well point to bottom with no clear reason.
Thanks!
The text was updated successfully, but these errors were encountered:
thank you folks. I haven't worked on this project for a while, so, I must look back into it to recall if I made it to get it fixed anyhow. thank you again!
I think this does raise the question of whether if there would be value in having the option to both offset the spring arm's point position and the camera itself relative to the spring arm's spring_length point. As opposed to just the former, like how it is currently.
Issue description
For a PCam with follow_mode as ThirdPerson, I wrote this code expecting the camera to rotate around the target (which is the character object), but instead, this method is actually rotating the camera around its own Y.
Steps to reproduce
a. Priority = 0
b. Follow Mode = Third Person
c. Follow Target = CharacterBody3D
d. Follow Offset = (0, 10, 10)
e. Spring Length = 10
f. Create a script and add the code I wrote above
g. Run
(Optional) Minimal reproduction project
Additionally, if I set Look at Mode to Siple and Look at Target to CharacterBody3D (in face any other object), the camera will as well point to bottom with no clear reason.
Thanks!
The text was updated successfully, but these errors were encountered: