I just want to make it so that if part a detects a object is under it and the distance between it is smaller than a given number value a it will float up at value b heigh and adjust its height when walking over ramps and bumps on the floor or mountains to stay a value b still. Only problem is I have no idea how to make it detect the distance off the floor and adjust it reliably as my attempts cause it to part a to fly side ways.
Are there any tutorials any resources that can help?
(part.Position - partBelowIt.Position).magnitude
Simply cast a ray down, about 100 studs under the player, And then use Magnitude or compare Y values of the ray
Wow this is beyond helpful comparing with magnitude rather than using a short ray fixed a problem my old attempts had thanks a lot!
1 Like