So I was experimenting a bit with making a gun and decided to have bullet holes where the bullet is supposed to hit. Now it works, partially.
i mgur(DOT)com/gQw2ZIn
This is the problem that I am having. When I set the bullet's position with CFrame to where the laser hits (yes there is a laser that comes out from the gun :D), the bullet goes on top of the object.
#################################################################################
local bullet = Instance.new ("Part")
bullet.Parent = Game.Workspace
bullet.Name = "Bullet"
bullet.CFrame = CFrame.new (m.Hit.p)
bullet.Size = Vector3.new (0.1, 0.1, 0.1)
bullet.Anchored = true
bullet.CanCollide = false
bullet.Shape = Enum.PartType.Ball
bullet.BrickColor = BrickColor.new ("Really black")
#################################################################################
That is the part of the code that has to do with the bullet. "hit" is where the laser hit.
As a final attempt to explain the problem in case someone didn't understand, if I shoot the legs of those dummies, the bullet appears on the head or shoulders. Damage is still dealt though.
I'd really appreciate some help here. I thought changing position with CFrame would allow me to put things inside one another, so I could have the bullet inside whatever it hits, but it seems that it doesn't want to cooperate. |