I have been trying to figure out how to use a vector3 as a offset for local transforms in scripting.
Ex: An orbit camera looking at a the player. I want to use a vector3 to position the lookat point slightly to the right of character. Also, when I rotate the camera, the offset should rotate with the camera so the offset stays on the right. Instead of that happening, the offset moves the lookat point on the world x-axis instead of the local axis.
You create a gameobject “target” set the character as parent of this target (on the editor), your camera look at this target, so when you move / rotate your character, the target follow the movement and your camera still look at the right point.
(And maybe set the camera the children of this target).