Vundeq
(Vundeq)
1
hey there, i am currently creating a gun.
for the bullet im trying to use a beam attached onto a part, however whenever i shoot, this happens
https://gyazo.com/75c0af933e69b74fec397b4aa31f9765
i tested in an isolated environment to see if it was CFrame causing this issue but nope, rotating and moving worked flawlessly as seen in this gif
https://gyazo.com/15a29d019e7b5a22d99b692b0733d749
any ideas? here is the line that cframes the part
bullet.CFrame = CFrame.new(PositionFrom,Position)*CFrame.new(0,0,-distance/2)
1 Like
Are you using Attachment.CFrame or Attachment.WorldCFrame? And/or .Position vs .WorldPosition?
Vundeq
(Vundeq)
3
hey, not actually moving the attachments, just the part theyre parented to, the part is invisible 
Can you post the entire script or relevant parts of it? It’s not clear from the one line you posted and the screenshots what’s going wrong
Vundeq
(Vundeq)
5
sure, this should be everything relevant
game.ReplicatedStorage.Fire.OnServerEvent:Connect(function(Player, barrel, mouse)
local rey = Ray.new(barrel, (mouse- barrel).unit*300)
local hitted, Position = game.Workspace:FindPartOnRay(rey, Player.Character, false, true)
local distance = (barrel-mouse).magnitude
local bullet = game.ReplicatedStorage.Bullet:Clone()
bullet.Parent = game.Workspace
bullet.Anchored = true
bullet.CanCollide = false
bullet.CFrame = CFrame.new(barrel,Position)*CFrame.new(0,0,-distance/2)
bullet.Size = Vector3.new(0.2,0.2,distance)
game.Debris:AddItem(bullet,5)
end)