I want this part to continue on a straight line, unaffected by gravity.
I want to keep using vectorforce (in order to learn it) instead of tween or bodyforce, and I have tried setting the involved parts to massless but does not seem to do anything. You can see that it moves forward in the direction I want , but succumbs to gravity or whatever force is pulling parts down.
Here is the code
local projectile = game.ReplicatedStorage.Meshes.WindProjectile:Clone()
projectile.Anchored = false
projectile.CanCollide = false
projectile.Massless = true
local particleblock = game.ReplicatedStorage.VFX.Wind.WindProjectile1:Clone()
particleblock.Anchored = false
particleblock.CanCollide = false
particleblock.Massless = true
-- Where I am defining the positioning of the parts
local function Positioning()
local offsetCFrame = CFrame.new(0,1,-5)
projectile.CFrame = charahum.CFrame:ToWorldSpace(offsetCFrame)
local current = projectile.CFrame
new = current * (CFrame.new() * CFrame.Angles(math.rad(9),math.rad(-17.5),math.rad(-151.922)))
end
local function Positioning2()
local offsetCFrame = CFrame.new(0,0,-10)
particleblock.CFrame = charahum.CFrame:ToWorldSpace(offsetCFrame)
local current = particleblock.CFrame
new2 = current * (CFrame.new() * CFrame.Angles(0,0,math.rad(28)))
end
local slashTrack = Animator:LoadAnimation(animefold["Slash"])
slashTrack.Priority = Enum.AnimationPriority.Action
slashTrack.Looped = false
hum.WalkSpeed = 0
hum.JumpPower = 0
-- Setting the Positions
Positioning()
Positioning2()
projectile.CFrame = new
particleblock.CFrame = new2
particleblock.Parent = projectile
local weld = Instance.new("WeldConstraint")
weld.Part0 = projectile
weld.Part1 = particleblock
weld.Parent = projectile
local vekattach = Instance.new("Attachment")
vekattach.Parent = particleblock
-- Here is the force
local vel = Instance.new("VectorForce")
vel.Attachment0 = vekattach
vel.Force = Vector3.new(0,0,-1)
vel.Parent = particleblock
slashTrack:Play()
slashTrack:AdjustSpeed(0.75)
slashTrack.Ended:Connect(function()
hum.WalkSpeed = 16
hum.JumpPower = 50
end)
wait(0.4)
projectile.Parent = workspace