I'm trying to make a pistol, but I'm stuck at this part. The char.CharPistol.Shoot
is the pistol's barrel inside the character.
bullet.Velocity = (char.CharPistol.Shoot.CFrame.LookVector * Vector3.new(1, 1, 1)) * 10
The bullet flies left
bullet.Velocity = (char.CharPistol.Shoot.CFrame.LookVector * Vector3.new(-1, 1, -1)) * 10
The bullet flies right. If the two values on the side are not equal, the bullet flies weirdly, but not forward. How can I make the bullet fly straight forward?
try using vector3.Unit
local gun = workspace.Part local aim = workspace.Part2 bullet.Velocity = (gun.Position-aim.Position).Unit * Speed
Place the aim part in front of the gun part and weld them
(sorry for my bad english)