![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Dumuz |
I have a Transform() looking_at a target node and I want to slerp() the basis of a spatial node to whatever the transform is looking_at. But it just ignores the slerp() without any errors coming up. I don’t know what I’m doing wrong.
_process(delta):
var p2_dummy = Transform()
var p2_look = $Player1.global_transform.origin
p2_dummy.looking_at(p2_look, Vector3(0,1,0))
$Player2.global_transform.basis =
$Player2.global_transform.basis.orthonormalized().slerp(p2_dummy.basis, delta)
These are the lines that should be rotating it, but it just constantly faces one direction. Please help
Why are you casting Player1’s origin
to a Vector3
? AFAIK, it’s already a Vector3
.
Ertain | 2020-05-19 08:44
Thanks for catching that. That was a typo when i was copying it into this forum, I fixed it to better reflect what it is in engine.
Dumuz | 2020-05-19 17:57