How do I make something point at something


kind of like this but without the eye moving
oh and also make the thing the mouse

Hey @Limeelon -

Here’s a wick project with two objects, the “Point at me!” clip follows the mouse, and the arrow will rotate to “point” at it.

This is a tricky thing that comes up a lot in gamedev; lots of these things are solved with Trigonometry! – https://math.stackexchange.com/questions/1201337/finding-the-angle-between-two-points

But of course, you don’t necessarily need understand the underlying math. Just having a general sense of it, and copy+pasting the code will do!!

P.S., there may be plans to make this a built-in thing in Candlestick :smiley:

Point at me1-9-2026_23-01-04.wick (8.8 KB)

2 Likes

For reference, here’s the code that’s on the “Point at me” clip:

this.x = mouseX;
this.y = mouseY;

// Calculate distance between objects
const dx = pointAtMe.x - arrow.x;
const dy = pointAtMe.y - arrow.y;

// Calculate angle in radians
var radians = Math.atan2(dy, dx);

// Wick stores rotation in degrees -- convert to degrees
arrow.rotation = radians * (180 / Math.PI);
1 Like