Best way to Pick up and Object and Fling It (Unity 2D)
Hi everyone,
I'm learning and wanted to try a game where I pick up an object and then throw it (2D fling from left to right). So far I think I have the pick up part fine, I essentially get an "onMouseDown" then move the item using transform.position to mouse point.
But I'm unsure how to move it from there, I get that maybe I can get the start and end of the mouse down/up, and use the difference (and maybe speed) of the up and down to create an approximate vector to throw right (and leave gravity base don unity rigidbody2d component).
The thing is, that means the moment you touch the object, thats it, your vector is already being calculated. I want it so that if they stop moving, that essentially is the "start" and then because they fling it fast, it ends when they let go (if they're slow however, it just moves the object around).
Interested in thoughts regarding implementation. Cheers all!
Your answer
Follow this Question
Related Questions
How to fix minor jitter/stutter when moving a 2D character using physics in FixedUpdate() 0 Answers
How to make player launch toward mouse position, but with a consistent velocity? 1 Answer
2D Velocity movement on slope hops when moving left/right 0 Answers
How do I assign a velocity to an object on only 1 axis? 1 Answer