Copy link to clipboard
Copied
I'm following a yt tutorial that's not for mac on a mac and I keep getting this simple error
error : error : argument 1 to sampleImage() must be 2 numbers
this is my expression:
p = thisComp.layer("NULL").transform.position[0]
s = thisLayer
a = s.sampleImage(p, [.1,.1])[3]
linear(a,0,1,0,100)
I'm trying to get the opacity of an image to go from 0 to 100 when the mouse hovers
Any help will be greatly appreciated so that I can learn with you guys!
Copy link to clipboard
Copied
Hi,
i'm not sure but it seems you need the x and y coordinates for sampleimage to work.
Try removing the [0] (points to the x-coordinate). Maybe it helps.
p = thisComp.layer("NULL").transform.position;
Copy link to clipboard
Copied
Akira, you are the best!! I can't believe it was that simple jajaja.