So I’m giving a try at making a raycasting gun. I know that RaycastResult.Position returns the position and you can position the parts that way. But it doesn’t rotate, for example if you shot at a rotated wall, the bullet hole would not be on the wall it would be in the wrong rotation. Now, there’s a property called RaycastResult.Normal. It returns the face Vector3 that the raycast hit on. So my question is, how can I rotate my bullet hole using this property? My current script if you need it:
Result: The RaycastResult BulletHole: The cloned Hole
if Result then
local Position = Result.Position
local BulletHole = Assets:WaitForChild("BulletHole"):Clone()
BulletHole.Parent = GunParts
BulletHole.Position = Position
Debris:AddItem(BulletHole, 5)
end
This was already solved, but the normal is the Vector3 direction facing outwards on the part you hit.
The normals are shown by the arrows in the diagram.
Also you said you used CFrame.lookAt(), which is fine, but there is a function CFrame.lookAlong() for exactly what you want.