Ok, Good luck my good fellow…
I’m using tween to make the magma model get bigger and then smaller all the time. it’s just an effect and i use a “for” loop because there are three parts in the model and i want to do the effect to all the parts
Hope this video helps you to understand
Actually i want to make the effect for every part in a different time but i don’t know how i can do that, probably making 3 tweens…
Why in the maxforce you aren’t using (math.huge) ?
also i’m gonna be afk, but keep trying… i’ll be right back
I’m back. I don’t know why the vfx keeps separating, it’s all welded together to the primary part.
i think we need to find a way to use LinearVelocity in a model instead of using primary part…
And this is what happens with your code:
Maybe making the Orientation of the parts stay the same all the time with CFrame.Angles will solve it?
Oh wait, Maybe LinearVelocity moves and rotates the parts too.
Also, modify the line of the MagmaModel:PivotTo() to MagmaModel:PivotTo(HumanoidRootPart.CFrame * CFrame.new(0,3,-10) * CFrame.Angles(0,math.rad(90),0))
So it’s orientation is right
You want it to look right??? Dang it says I’ve replied 21% of the messages. I will edit this message from now on.
Here’s the current script:
-- // Variables \\ --
local RemoteEvent = script.Parent
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local Debounce = false
RemoteEvent.OnServerEvent:Connect(function(player, AbilityModule)
-- // More variables...
local Character = player.Character
local Humanoid = Character:FindFirstChild("Humanoid")
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
---------------------------------------------
-- // Functionality \\ --
if Debounce == false then
local MagmaModel = script.Parent.VFX.FistVFX:Clone()
MagmaModel.Parent = game.Workspace
--MagmaModel:PivotTo(HumanoidRootPart.CFrame * CFrame.new(0,3,-10) * CFrame.Angles(0,0,0))
MagmaModel:PivotTo(HumanoidRootPart.CFrame * CFrame.new(0,3,-10))
local MagmaModelChildrens = MagmaModel:GetChildren()
local TweenInfo1 = TweenInfo.new(
0.5,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
false,
0
)
for i,v in pairs(MagmaModelChildrens) do
if v:IsA("BasePart") then
local Goal = {
Size = v.Size + Vector3.new(0.5,0.5,0.5)
}
local TweenSizeAnimation = TweenService:Create(v,TweenInfo1,Goal)
TweenSizeAnimation:Play()
end
end
local Attachment = Instance.new("Attachment")
Attachment.Parent = MagmaModel.PrimaryPart
local LinearVelocity = Instance.new("LinearVelocity")
LinearVelocity.VectorVelocity = HumanoidRootPart.CFrame.LookVector * 100
LinearVelocity.MaxForce = math.huge
LinearVelocity.Attachment0 = Attachment
LinearVelocity.Parent = Attachment
local debris = game:GetService("Debris")
--debris:AddItem(MagmaModel,10)
end
end)
VFX.rbxl (141.2 KB)
I’m going to take a break. I’ll respond asap.
Ok, no problem take your time, i’ll search for solutions
Okay back did you find any solutions so far?
Looking at this video again of the lag, i believe it is running the tween before you are instancing the part, try to move the tween code to after the instancing.
So, instance the part, then run the bodyvelocity, then run the tween.
Sadly, i didn’t found any one…
I did that in the code, read it again
You’re right you changed it already, i was looking at the first code.
And that didn’t rid the lag when you were using bodyvelocity?
It wasn’t the lag it was the tween. Whenever the tween plays it stops the velocity.