I have this hitpart that displays where a bullet was fired (essentially bulletholes), but when it hits, i'm not completely sure how to orient it the way the side of a part it hit was oriented. I assumed it would just do it automatically, I was wrong. My code is here, any help is appreciated
local hitpart = game.ReplicatedStorage.Hit:Clone() hitpart.Position = position -- hitpart.Orientation = part.Orientation hitpart.Parent = game.Workspace game.Debris:AddItem(hitpart, 1)
(I commented out the orientation thing since that didn't work either, the part variable is the part it hit)
I believe the issue is that you're relying on the part the bullet hits rather than the position of the bullet itself. Both Mouse.Hit and raycasting will give you the CFrame of where the bullet hit (if you're using something like BodyVelocity then you can just use the CFrame of the bullet). You can then use the orientation of the part the bullet hits to determine the orientation of the bullet hole.
If you found this answer helpful, please consider marking as an answer and upvoting!