Hello, i noticed my bullets from my… lets call it just gun, my gun bullet holes is actually placing weird, i tried looking for fixing methods but found only fastcast things, my bullet system using bodyforce and directions (Smth like ACS gunsys)
there’s bullet hole fragment:
Bullet.Touched:Connect(function(hit)
if (hit and (hit:IsA("Part") or hit:IsA("MeshPart") or hit:IsA("UnionOperation")) and
hit.CanCollide and hit.Material == Enum.Material.Concrete) then
local BulletHole = game.ReplicatedStorage.FXgun.BulletHole:Clone()
local impactPosition = Bullet.Position
local impactNormal = (impactPosition - hit.Position).Unit -- rotation -- not works correctly
BulletHole.CanCollide = false
-- CFrame what weird works (rotation)
local bulletHoleCFrame = CFrame.new(impactPosition, impactPosition + impactNormal)
BulletHole.CFrame = bulletHoleCFrame
BulletHole.Parent = workspace.GunDebris.BulletHole
Debris:AddItem(BulletHole, 4)
local newWeld = Instance.new("WeldConstraint")
newWeld.Part0 = hit
newWeld.Part1 = BulletHole
newWeld.Parent = BulletHole
local hitSound = BulletHole:FindFirstChild("HitS") -- sound
if hitSound then
hitSound:Play()
end
-- effects
BulletHole.Dirt:Emit(1)
BulletHole.Smoke:Emit(3)
BulletHole.Stone:Emit(2)
-- destr bullet
Bullet:Destroy()
print("bullet ended")
elseif hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and not (hit.Parent == char) then
print("HumanoidDMG")
Bullet:Destroy()
end
-- firing createshell
if CreateShell then
CreateShell()
else
warn("CreateShell function is not defined!")
end
end)
Please just say me how to do it normal…