Skip to main content
ximenab8971344
Participant
January 17, 2022
Question

first time user trying to figure out this error

  • January 17, 2022
  • 1 reply
  • 200 views

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!

This topic has been closed for replies.

1 reply

Participating Frequently
January 17, 2022

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;

ximenab8971344
Participant
January 17, 2022

Akira, you are the best!! I can't believe it was that simple jajaja.