Scale an object as it’s child moves along z axis

Okay, so a few things. First, you can post code directly in the thread which is far preferable to posting a screenshot. Look at this thread for how to do it properly: Using code tags properly

As for your issue, and what you tried… you didn’t debug/resolve the compiler error even? ‘pos’ seems to be a transform and not a float, so obviously that code won’t work.
Perhaps you wanted to put current scale into there, instead (guessing from your code*).

It’s possible you might want to use ‘localPosition’ when you get it working (relative from the parent, rather than general world… not sure)