Hi.
(for my 2d fighting game if your confused lol)
While I was working on a fighting game of mine, I started to test out some
glitches and find out that the fireball’s for my game will sometimes (not all the time) go in a straight line.
I am using LinearVelocity
and a LookVector
for this fireball program.
Some methods I tried to resolve this were making a new part and welding it to the HumanoidRootPart. I also did some changes to the CFrame
to make sure the Part is only facing straight. The new part’s LookVector
was used on the VectorVelocity
part of the code.
(i apologize if you can’t understand what i am trying to say)
It mostly happens when the player is moving, then stops moving and shoots the fireball to the enemy/person.
Video explains everything:
robloxapp-20221026-1950538.wmv (302.3 KB)
Here is the velocity code:
local PB = player.Character:WaitForChild('PositionBox')
local Part = script:WaitForChild('Part'):Clone()
Part.Parent = workspace
Part:SetNetworkOwner(PB)
Part.CFrame = PB.CFrame
local Attachment = Instance.new("Attachment", Part)
local LV = Instance.new("LinearVelocity", Attachment)
LV.MaxForce = math.huge
LV.VectorVelocity = (PB.CFrame.LookVector * 50 + Vector3.new(0,0,0))
LV.Attachment0 = Attachment
game.Debris:AddItem(Part, 2)
Some help would be appreciated, thank you.