Hello, I’ve been trying to make an object throwing system like in Pokemon Go, but I can’t figure out how. This is what i have so far:
I think I need to calculate the screen position aswell but I can’t figure out how to get the correct location. Does anyone have any ideas about this? This is what the game looks like at the moment(I started it yesterday, no actual graphics yet):
Imo save vectors in tick and on mouse release compare last 2 vectors… like when first frame is vector 0 0 0 and second is 1 2 5 then subreact and multiply that values by something and launch ball… im really not sure if this can work but its a shot
Thanks for the reply! I thought about that but the problem is I want the player to use some “Force” while throwing it. If I do it this way you can slowly push it forward and release it 20 seconds later and the ball will still move forward with a lot of force.
No no because you compare only last 2 vectors time wont affect force… only position between last 2 frames
Another thing is that you can truly make only “2d” vector with mouse… x and y… z must be calculated based on x and y between last 2 vectors somehow…