Discuss Scratch

keshavcoolio
Scratcher
2 posts

Eye following trick thing.

I want to do the same thing, but I can't find any tutorials. If you know zonxscratch, he made the players eyes follow the mouse pointer in both his shooter games. I want mine to look like that. Here is the game link. https://scratch.mit.edu/projects/1270346094/

Last edited by keshavcoolio (Feb. 16, 2026 16:32:40)

cutellama12345
Scratcher
100+ posts

Eye following trick thing.

keshavcoolio wrote:

I want to do the same thing, but I can't find any tutorials. If you know zonxscratch, he made the players eyes follow the mouse pointer in both his shooter games. I want mine to look like that. Here is the game link. https://scratch.mit.edu/projects/1270346094/
I think u could do a mini parallex type thang
keshavcoolio
Scratcher
2 posts

Eye following trick thing.

yo the be a llama worked fr
DanDanbingobam
Scratcher
38 posts

Eye following trick thing.

To get that look where the eyes follow the mouse pointer (like in zonxscratch's games), you need to make the eyes their own separate sprite or clones. You can't just group them with the player's body, because they need to move independently.

The Simple Method (Using a separate Eye Sprite):

Create a sprite for the eyes.

Use this script to make them follow the player but look at the mouse:

when green flag clicked
forever
go to [Player v] // Stays centered on the player
point towards [mouse-pointer v]
move (5) steps // This 'offsets' them toward the mouse
end

The Advanced ‘Zonxscratch’ Method (Restricted Movement):
If you want the eyes to stay inside the head and not just ‘point’ at the mouse, use this logic. This makes the eyes move more realistically:

when green flag clicked
forever
go to [Player v]
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [10]> then
move (4) steps // The eyes move to the edge of the face
else
move ((distance to [mouse-pointer v]) / [2]) steps // Subtle movement if mouse is close
end
end

Tips for the best look:

Costume Center: Make sure your eye costumes are perfectly centered in the Paint Editor. If they are off-center, they will wobble weirdly when they rotate.

Layering: Use the block on the eyes, or so they sit on top of the player's skin but under their hair/hat!

Rotation Style: Set the rotation style to ‘all around’ so they can track the mouse 360 degrees.

Powered by DjangoBB