# How do I get a Vector3 that is a fixed distance behind a Node3D?

4.2

### Question

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.

FWIW, the helicopter is a Rigidbody3d.

There are 2 simple ways I can think of:

1. `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.

2. 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).

1 Like

Use Node3Ds. You can name one arm and one child named mount.

Put arm in zero position of ship turn on “top level” and use a remote transform node to update position only.

Put mount at desired offset, and place camera as child and set desired angle.

Rotate arm with user input.

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

The problem here is that when the helicopter pitches forward, the camera moves up and forward.

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.

I got it!

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.