- Home /
How to Move two spheres over the surface of irregular shapes meshes towards the closest X and Y boundary of mesh without leaving its trigger till end.,?
i have different meshes of irregular shapes.(oval,square and circle etc) I need a function which help me "To create two spheres over the mesh on my mouse click position and move those spheres towards the closest border vertex of mesh (like one ball should moves towards border.x of mesh and the second should move towards the border.y of mesh)". But the spheres should not leave mesh, both spheres must translate over mesh surface, and when they reaches till end of mesh it should stop their movement. i actually want to calculate the distance from the point where i clicked and to the point where ball end it's movement.But i need to calculate distance in each step when the moving balls changes it's vector3 from the point i clicked, till the end. and the ball must move over the mesh till it reaches to the closest border of mesh.
,i have different meshes of irregular shapes.(oval,square and circle etc) I need a function which help me "To create two spheres over the mesh on my mouse click position and move those spheres towards the closest border vertex of mesh (like one ball should moves towards border.x of mesh and the second should move towards the border.y of mesh)". But the spheres should not leave mesh, both spheres must translate over mesh surface, and when they reaches till end of mesh it should stop their movement.
i actually want to calculate the distance from the point where i clicked and to the point where ball end it's movement.But i need to calculate distance in each step when the moving balls changes it's vector3 from the point i clicked, till the end. and the ball must move over the mesh till it reaches to the closest border of mesh.