For some reason when I shoot the gun the bullet is sideways, I’ve been trying to tweek the orientation but it still doesnt change… How do I fix this?
Video: Orientation Issue - YouTube
–Server
game.ReplicatedStorage.Events.Shoot.OnServerEvent:Connect(function(player, muzzlePos, MuzzleOrientation, mousePos, GunDmg, HeadShot,HumanoidRootPartOrientation)
local Bullet = game.ReplicatedStorage["Meshes/50bmg (4)"]:Clone()
Bullet.Name = "Bullet"
Bullet.Parent = game.Workspace
Bullet.CanCollide = false
Bullet.Anchored = false
Bullet.CFrame = CFrame.new(muzzlePos, mousePos)
print(MuzzleOrientation)
-- Bullet.Orientation = Vector3.new(math.rad(10), 0,0)
Bullet:SetNetworkOwner(player)
local BodyVelocity =Instance.new("BodyVelocity")
BodyVelocity.Parent = Bullet
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyVelocity.Velocity = (Bullet.CFrame.LookVector * 100)
Bullet.Touched:Connect(function(hit)
Bullet:Destroy()
if hit.Parent ~= player.Character then
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Name == "Head" then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(HeadShot)
else
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(GunDmg)
end
end
end
end
end)
task.wait(5)
Bullet:Destroy()
end)
end)
Client:
function Shoot()
fireAnim:Play()
shootSound:Play()
Framework.module.ammo -=1
debounce = true
game.ReplicatedStorage.Events.Shoot:FireServer(Framework.Armory.Muzzle.Position, Framework.Armory.Muzzle.Orientation, mouse.Hit.p, Framework.module.damage, Framework.module.headShot)
if Framework.module.fireMode == "Full Auto" then
isShooting = true
end
end