Hey everybody, been stuck with this for a while.
Following scenario:
I'm building a (very) simple pool game. Currently, I'm setting up the basic control of the queue.
Basically, what I'm trying to do is this:
- When the mouse button is pressed, the queue's angle gets locked (no problemo)
- the queue gets moved on its current angle according to the distance the mouse gets moved while the mouse button is pressed (here is the issue)
- the queue should just be movable in one direction
I figured, I have to do some sinus and cosinus callculations to be able to perform this for every possible queue angle.
I worked out some solutions, experimented a bit with lerp, but in the end, I couldn't combine both x and y coordinates. One on its own (obviously) wouldn't be much of a problem.
If there would be a way to combine both X and Y distance of the Mouse, then I could use the "move forward" action for the queue..
Did I explain well what I'm up to?
If not, I'm happy to explain if there are questions.
As always, anyy help is aprecciated.
Thank you.