So I’ve made this gun and I want the front of the bullets to orientate with the Mouse
Lets say the yellow is the bullet and the red is where Im aiming, you see how the bullet is angled to go towards my mouse?
Instead it goes like this
https://gyazo.com/917435a355b3b77b1e0140456623a79f
if Debounce == false and Configs.DB.Value == false then
Debounce = true
Configs.DB.Value = true
local Bullet = Instance.new("Part")
Bullet.Name = "Bullet"
Bullet.Parent = workspace.Debris
Bullet.Material = Enum.Material.Neon
Bullet.BrickColor = BrickColor.new("Bright yellow")
Bullet.Transparency = 0.6
Bullet.Position = Barrel.Position
Bullet.Anchored = true
Bullet.Orientation = Vector3.new(BMouse.X, 0, BMouse.Y)
Bullet.CanCollide = false
Bullet.Size = Vector3.new(2.941, 0.292, 0.297)
local TS = game:GetService("TweenService")
local TweenTime
local TInfo = {}
TInfo.Position = BMouse
if (Barrel.Position - BMouse).Magnitude <= 800 then
TweenTime = 0.05
else
if (Barrel.Position - BMouse).Magnitude > 800 and (Barrel.Position - BMouse).Magnitude <= 2000 then
TweenTime = 5
else
if (Barrel.Position - BMouse).Magnitude >= 2001 then
TweenTime = 10
end
end
end
local FireTween = TS:Create(Bullet, TweenInfo.new(TweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.In), TInfo)
FireTween:Play()```