I’m making a gun system and I’m having problems with the bullet holes CFrame:
The code:
local function CreateBulletHole(Result)
if Result.Instance then
local CBulletHole = BulletHole:Clone()
CBulletHole.HoleTexture.Color3 = Result.Instance.Color
--CBulletHole.HitParticle.Color = Result.Instance.Color
CBulletHole.Parent = BulletFolder
CBulletHole.CFrame = CFrame.new(Result.Position, Result.Position + Result.Normal)
CBulletHole.HitParticle:Emit(10)
Debris:AddItem(CBulletHole, BULLET_HOLE_LIFETIME)
end
end
This issue is fairly easy to solve. I’ve had it before.
Simply add a
* CFrame.Angles(0, 0, math.pi / 2)
after the CFrame part.
All this code does, is rotate the hole 90 degrees (pi / 2 in radians) in the Z axis. If this still doesn’t work, try other axies.
I think the texture is facing the camera, which is why it’s looking weird. Idk how to script that part. But yeah, it’s obvious that the problem is smt with the texture/trail/effect/particleemitter which is facing towards the camera. It should orientate differently, depending on what part you shoot.