how to measure the distance between the object and the cursor only in X? desirable that the object was a point of "0" (the origin point)
What about maths ?
Object.X - Mouse.X
(or the opposite, depends on what exactly you're wanting to do)
The "Distance" function will work fine too:
distance(x1, y1, x2, y2)
or in your case, something like this:
distance(Object.X, Object.Y, Mouse.X, Mouse.Y)
Develop games in your browser. Powerful, performant & highly capable.
CodeMasterMike: He only wanted the "X" distance.
Oh, I missed that part, sorry.
I have a ball, which should turn left or right, depending on whether - left or right of the cursor on the ball. How can I do?
RACR2:
Try something like
Cursor.X < Ball.X
-- Go right
Else
-- Go left
RACR2: Try something like Cursor.X < Ball.X -- Go right Else -- Go lefthow to set the direction of rotation of an object?
-- Go lefthow to set the direction of rotation of an object?
oops, already knew ^^"