How to fix this raycast issues

I am making this raycast Ice and it’s work on ground but when I put on a part that curve or wall , It dosent change the orientation, how should I fix that? ( Raycast 100% Work )

clone is a part
Clone.Orientation = Vector3.new(ray.Instance.Orientation.X,-ray.Instance.Orientation.Y,-ray.Instance.Orientation.Z)
Clone.Position = ray.Position + Vector3.new(0,.1,0)

You are using BlackList for the Ray so it wont collide with the part itself?

It appears that you are encountering an issue with the orientation of a raycast not changing when it hits a curved or wall part. To resolve this issue, you could try to adjust the orientation of the clone part to match the normal of the surface that the raycast hits, rather than the orientation of the surface itself.

Here’s an updated code example:

Clone.Orientation = ray.Normal
Clone.Position = ray.Position + ray.Normal * 0.1

This should correctly orient the clone part to the surface normal of the part that the raycast hits, even if it is a curved or wall surface.

1 Like