Expression to offset rotation based on position

Created a simple spherical eye ball in action. I have the x and y rotation of the eye linked to a dummy axis (LOOK_AT) and all working well. However the rotations only work as intended when the eye is in the middle of the frame. Ideally within the expression (or a second dummy axis) is something which compensates for the rotation of the eye based on its position. End result being a bunch of eye balls in different positions all looking at the same point.

Current expression for x rotation is:
LOOK_AT.position.y*-0.05

and y rotation is:
LOOK_AT.position.x*0.05

I won’t mention the Z words just yet…

I believe that in the rotation channel of the eyeball you simply enter the expression lookat(object.position,eyeball.position). In fact, to make it simpler, you can just enter lookat(object.position,position). You can then copy that eyeball and it’s axis endlessly and each copy will follow the same object.

Hi @ytf. Not sure what i’m doing wrong but currently getting an error saying ‘uknown channel position’ when i try that

Your expressions must not be referring to the axii with their correct names.

Of course, there’s always the Lookat link, but it’s restrictive.

yeh ‘look at’ for my first port of call but didnt work as needed. will investigate further into the error. thanks so much @ytf

Also bear in mind that flame does not concatenate. If the object that the eyeball is looking at is the child of another axis and you move the parent, flame does not create data for the new position of the child.