I am trying to create a 3rd person camera rig for a helicopter. I want the camera to be at a fixed position above and behind the helicopter. I don’t want my camera to rotate at all except on the Y axis.
var pnt = helo.global_position + helo.basis.z * 2 + Vector3(0,3,0)
My math is always wrong on the first try (I am not Tony Stark), but it’s something like that.
Place a Marker3D at the location behind the helicopter (and as a child of the helicopter) where you want the camera to be, and make the camera a child of the marker. Be sure the camera has location and rotation of (0,0,0).
You could try a RemoteTransform3D, you may have to update the rotation on the Y axis yourself, the position and lack of other rotations/scale are a great start though.
Put this on the Helicopter, Add a “pivot” for the camera as a sibling. set the remote transform’s path to the pivot
I’ve never used a remote transform node, I’ll look into that.
I can’t rotate with user input because the user is busy controlling the helicopter, which is rather involved. The camera needs to remain behind the helicopter and looking in the correct direction on its own.
I think I could make it work with a setup like this:
A remote transform with a scripted vertical offset to set the camera position, then a Node3D above the helicopter as the camera’s target to look_at. I could manipulate the location of that look_at target in code to aim the camera up or down as the helicopter ascends or descends.
I won’t be able to test until this evening (in about 12 hours) but I think that might work.
No, not that one. That was all kinds of badness, lol.
I used a RemoteTransform3D as well as a look_at target above the helicopter with a little code to get the rotation.y of the helicopter and translate that to the RemoteTransform3D’s target.
This solution has a few problems, but it’s a solid placeholder for now while I work on other stuff, like the actual flight model, terrain, and animating the helicopter, haha.