ball 3d movement, drag and release force.
Hi!
I need help with making a script that will let me move a ball in my minigolf game using the mouse.
I have been successful in 2d environment but not in 3d, and I do not understand why.
I think it has something to do with that I need to use ray casting in order to correctly that mouse positions.
I am thinking, firstly I need the startposition of the mouse on onMouseDown, and track the position for a line renderer to draw a power (force) line with onMouseDrag, and then find out end position with onMouseUp.
I have tried doing this myself but I am only successful in moving the ball on the X-axis.
I want to move the ball like they do on the supplied video link but not on the Y-axis so that the ball can't escape the bounds of the minigolf course.
If there is anyone who is good at coding this in c# then I would be forever grateful as this is going to be a work example for me to apply to university and the time to apply is running out.
Thanks in advance!
link text