Hello guys, i’m trying to make an anime attack but i can’t make that the model moves forwards.
if can i make it with BodyVelocity it would be great, but if you have any idea on how to make something like that that would be cool.
This is the code:
-- // 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 = HumanoidRootPart
MagmaModel:PivotTo(HumanoidRootPart.CFrame * CFrame.new(0,3,-10) * CFrame.Angles(0,math.rad(90),0))
local MagmaModelChildrens = MagmaModel:GetChildren()
local TweenInfo1 = TweenInfo.new(
0.5,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
-1,
true,
0
)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Parent = MagmaModel.PrimaryPart -- I need to change this to something so it works for all the parts of the model
BodyVelocity.MaxForce = Vector3.new(5000,5000,5000)
BodyVelocity.Velocity = (HumanoidRootPart.CFrame.lookVector * 100) -- This doesn't work actually
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):Play()
end
end
end
end)
Just fyi you dont need to assign body velocity to all parts in your model like your scripts says… just weld all parts to the part you are moving with the body velocity.