I'm basically making a paintball game and I need the bullet hole to match the orientation of anything it hits. I was able to get the gun working well, although I can't seem to get it to match the orientation. Does anyone have a fix?
local function CreateBullet(bulletPos)
local bullet = Instance.new('Part', workspace)
bullet.FormFactor = Enum.FormFactor.Custom
bullet.Size = Vector3.new(3.4324, 3.4324, 0.01)
bullet.BrickColor = BrickColor.new("Black")
bullet.Shape = Enum.PartType.Block
bullet.CanCollide = false
bullet.CFrame = CFrame.new(bulletPos)
bullet.Anchored = true
bullet.TopSurface = Enum.SurfaceType.Smooth
bullet.BottomSurface = Enum.SurfaceType.Smooth
bullet.Name = 'Bullet'
DebrisService:AddItem(bullet, 999)
local shell = Instance.new("Part")
shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
shell.Size = Vector3.new(1,1,1)
shell.BrickColor = BrickColor.new(226)
shell.Parent = game.Workspace
shell.CFrame = script.Parent.Handle.CFrame
shell.CanCollide = false
shell.Transparency = 0
shell.BottomSurface = 0
shell.TopSurface = 0
shell.Name = "Shell"
shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20))
shell.RotVelocity = Vector3.new(0,200,0)
DebrisService:AddItem(shell, 1)
local shellmesh = Instance.new("SpecialMesh")
shellmesh.Scale = Vector3.new(.15,.4,.15)
shellmesh.Parent = shell
return bullet
end

1 comment
Yes I was wondering that too