Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i fix the bullet's direction?

Asked by 5 years ago
Edited 5 years ago

I'm making a fps game and all i get is a bullet facing the wrong direction here is some footage

Photo

and here is the code

Mouse.Button1Down:Connect(function()
local BulletRay = Ray.new(Weapon.Shoot.CFrame.p,Weapon.Shoot.CFrame.LookVector * 500)
local Part,Position,Normal = workspace:FindPartOnRayWithIgnoreList(BulletRay,{Character,Weapon})
local Distance = (Weapon.Shoot.CFrame.p-Position).magnitude
local Bullet = Instance.new("Part",workspace.World.DebrisItems)
Bullet.Anchored,Bullet.CanCollide = true,false
Bullet.BrickColor = BrickColor.new("Institutional white")
Bullet.Material = Enum.Material.Neon
Bullet.Transparency = .3
Bullet.Size = Vector3.new(.3,.3,Distance)
Bullet.CFrame = CFrame.new(Weapon.Shoot.CFrame.p,Position) *         CFrame.new(0,0,-Distance/2)
game.Debris:AddItem(Bullet,10)
end)

is there any way i can fix it?

0
This isn't really a fix but i know the problem i think the LookVector only faces foward of you and ignores rotation but thats all i know im not really sure how to fix it Oskar2266001 3 — 5y
0
Yeah but its the weapons shootpart not my head Dalbertjdplayz 37 — 5y
0
I would keep experimenting till it appears straight shouldn't be that hard Sapppower 17 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Had to rewrite the framework script

Ad

Answer this question