Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to place part on the top of a rotated part?

Asked by 3 years ago

I have a script that makes drops of blood fly out of the character when it takes damage. The problem is that it doesn't work on inclined surfaces very well.

Code for positioning:

local TopOfPart = Vector3.new(BloodPart.Position.x, Part.Position.y + Part.Size.y/2, BloodPart.Position.z)

BloodPart.CFrame = CFrame.new(TopOfPart)
BloodPart.Orientation = Part.Orientation

"Part" is the part that the BloodPart landed on.

Answer this question