object:PivotTo(Crame.new(result.Position + result.Normal) causes object to hover

EDIT: I misunderstood your problem, so this might have more than what you need.

I have found a solution to both of your issues. So I will combine them into one. For the issue with the floating, use:

object.CFrame = object.CFrame:ToWorldSpace(CFrame.new(0, x, 0)

or for a model, use

model:PivotTo(model.WorldPivot:ToWorldSpace(CFrame.new(0, x, 0)))

change x to however high you need. These also might need to be tweaked based on how the object is rotated.

For the issue with the raycasting, and putting it where the raycast hits and rotating it right, do this:

object.CFrame = CFrame.new(ray.Position, ray.Position + ray.Normal)

and for models, use

model:PivotTo(CFrame.new(ray.Position, ray.Position + ray.Normal)

I would like to credit the post made by @ExcessEnergy which helped me with this.

Sorry if I did this wrong, I am pretty new to using the devforum.

1 Like