Help with gun script

Hello! I’m trying to make a gun, everything is fine, the only problem is that the bullet does not come out as it should, how can I solve it?
Example Clip


function Activated(Plr,target)
	local Position = Handle.Position 
	local Bullet ="Part")
	Bullet.Anchored = false
	Bullet.CanCollide = false
	Bullet.Material = Enum.Material.Neon
	Bullet.Size =, 0.213, 0.21)
	Bullet.Color = Color3.fromRGB(255, 255, 0)
	Bullet.CFrame =,target) 
	Bullet.Parent = workspace
	local BodyVelocity ="BodyVelocity")
	BodyVelocity.MaxForce =,math.huge,math.huge)
	BodyVelocity.velocity = Bullet.CFrame.LookVector * 100
	BodyVelocity.Parent = Bullet

i dont know its in the x axis im not sure how to do it bcz im new scripter so try to change the x axis to 90 degrees or -90 and it should work

change it after all of the code so it will work
i dont know more than that

u resized it wrong the size should be, 0.213, 1.57)
1 Like

So it was just reversing the axes?

Yea the works with the front surfce,PosToLookAt)

the Cframe uses the part LookVector

The LookVector can be found by just adding a decal then just look for the high lighted part Then make sure use Z when u using CFrame for positioning parts/models on their back or front

1 Like

It’s actually CFrame.fromMatrix(pos, X, Y Z)

my bad u are right i forgot about this since i dont use cframe this days

1 Like