Etheroit
(Etheroit)
January 6, 2018, 3:18pm
#1
Hello there!
Anyone has got idea how to make script which will find the nearest point on surface between two specified parts?
I want to make script which will just specify the gravity to the part. It should work on wedges too tho.
Edit: At least way to specify what surface is player on would be appreciated
Thank you so much,
DevKurka
ColdSmoke
(ColdSmoke)
January 6, 2018, 3:31pm
#2
I hope you’re prepared to do a lot of math
1 Like
Etheroit
(Etheroit)
January 6, 2018, 3:34pm
#3
I guess so.
Maybe at least specifying surface won’t be that hard.
ColdSmoke
(ColdSmoke)
January 6, 2018, 3:39pm
#4
For a catch-all solution which it looks like you’re wanting to do I think you should start here
TaaRt
(TaaRt)
January 6, 2018, 3:47pm
#5
Ray parellel to surface, point as middle of ball.
Etheroit
(Etheroit)
January 6, 2018, 3:50pm
#6
But you can’t specify ray to find the nearest point on surface. You can only set the ray to look with a direction from it. I do now exactly know where is the arrow shown on image.
Etheroit
(Etheroit)
January 6, 2018, 3:51pm
#7
YOU ARE A GOD!!!
Thank you so much. Didn’t even know about this article.
TaaRt
(TaaRt)
January 6, 2018, 3:54pm
#8
if you have 2 rays along the surface (perpendicular to each other) and find closest point on those to the ball you have a rather accurate location, you do not need to know anything about the ball for that.
TaaRt
(TaaRt)
January 6, 2018, 4:00pm
#9
Also you are aware gravity works downwards, not in the direction of the surface right?
Etheroit
(Etheroit)
January 6, 2018, 4:01pm
#10
Yes, I do thanks.
The gravity thing is working. Just needed surface thing.
I get your idea now. It’s interesting, but I would just need to make much rays.
Thanks anyways!