How can i set the speed through the distance between objects?

Hey!

so im working on a mini golf game and i want to set the speed of the ball by the distance between the ball and the courser and came up with this soulution

it works but not quite how i want it to. the problem is that u have to move your courser very far away to get a bigger hit and its not consistent like in the first half the speed goes up slowly and the other half it goes up rapidly

so is there a way to make something like a circle around the ball that calculates the distance between the inner circle(Ball) and the edge?

Hey @Max0906
are you using a flat view (e.g. top view as selectable in the viewport) or do you use a perspective?

Hi! im using a TPP that u can orbit around the ball

Ok, and are you using a flat ground or does the area have some bumps? I am asking because your Z value could cause problems. You could try to only use the X and Y values of your vectors. And your perspective will generate more distant points even when you only move your mouse a little bit the lower you are with your camera.

1 Like

that seems to have done the trick just need to play around with the numbers. THX

1 Like