How can I create bullet trails?

Problem: I am trying to create bullet trails that originate from the viewmodel’s gun. But when I shoot the bullet trail is going in random places not in mouse position

VIDEO:

SCRIPT:


            local newbullet = replicatedstorage.OTHEROBJECTS.Bullet:Clone()
			newbullet.Parent = workspace
			newbullet.Position = viewmodel.Barrel.Position
			newbullet.CFrame *= CFrame.lookAt(newbullet.Position, mouse.Hit.Position, newbullet.CFrame.UpVector)
			
			local linearvelocity = newbullet.VelocityHolder.LinearVelocity
			linearvelocity.MaxForce = math.huge
			linearvelocity.VectorVelocity = newbullet.CFrame.LookVector * 100

you should Cfame of the trail * mousePos

Can you give me a simple line of script where I would implement this?

I fixed it by tweening to mouse position without the linear velocity

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.