... and set that to a variable, thanks! I would like to make the effect that if you were to drag an object and "fling" it, it would adopt the speed of the mouse.
well i'm not 100% sure if this is what you want to do, but I have a game I'm working on that flings things.
so yea if this is what you would like to be able to do... to "throw" something and have it behave with physics.. basically what you want to look at is:
apply physics impulse towards position.
impulse - (distance(Box.X,Box.Y,Touch.X,touch.Y))/10
x - touch.X
y - touch.Y
image point - 0
you'll also want to have drag/drop working as well.. though i rolled my own so I'm not sure if the drag/drop behavior would conflict with it.
Develop games in your browser. Powerful, performant & highly capable.
create 4 variables oldX, oldY, xVel and yVel.
everytick set xVel to abs(Touch.X - oldX), yVel to abs(Touch.Y - oldY), oldX to Touch.X and oldY to Touch.Y.
In that specific order.
Thanks Guys, I'm testing those out right now!