Hello!
I think about how to solve this problem best ( for android ).
My scene is as following:
I want to drag a GameObject called “Dragger” from the left side to the right side of the screen. On this “Dragger” is an flat cube attached via character joint attached - to swing like a tennis- or baseballracket when i drag the “Dragger”. Both are Rigidbodys, DragRigidBody Script attached to the camera.
I want to drag this as fast as possible form left to right to hit a ball in the center of the scene.
Now i have one big problem:
- I tweak mass and drag values of the racket + dragger to stop the dragger within the screen after release it.but this isn’t satisfying - because when i release the dragger to soon, it will end somewhere in the middle of the screen - release it later it shoots out of the screen. I built a collieder fram around my scene to avoid the “shootout” but now its bouncing back into the screen - not very satisfying either.
I tried a few codes i found in this forum, the smooth follow script of unity - but nothing seems to work well in my scene ( i’m not the biggest coder )
What i’m trying to figure out is, how to ease out the movement of the dragged object to the left or right side of the screen, no matter where the dragger was released.
And after all this i have one big questionmark left:
- I want to drag the racket as fast as possible form one side to the other, to hit the ball. What would be a good starting point, to measure the strenght / speed the ball was hit?
Would be happy about any tip - because i’m not the greatest coder, and i find myself at the moment in jungle of codes