BodyVelocity not working

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)

The model is not anchored.

1 Like

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.

2 Likes

The parts are welded, look at this:
image

and also, the body velocity doesn’t work too if i use only one part

1 Like

I dont see these parts referenced in your script… your model has a different name than the MagmaModel.

1 Like

The primary part of the model is the Part2

1 Like

Then reference this part by name in your script… and make sure all the weld constraints are tied to this part.

1 Like

It is referenced, and it’s the same as the one in the photo

1 Like

Youre right i missed that. . .wait, you’re cloning this?

1 Like

Ok, i have all welded to that part, but now how do i make the body velocity work?

1 Like

Yes, i’m cloning that because later i will delete it with debris

Is it a heavy model? You might need to give higher maxforce than 5000.

Im also confused to where your humanoidrootpart that is referenced in your script… is this in the model?

image

I have two attacks, i’m doing this one rn.

and i modified the max force to math.huge so it’s supposed to work, but it didn’t

The first script you posted is the MagmaFist script?

yes, it’s inside the MagmaFistRemote and the AttacksController is just a local script with UIS

When you clone the model and you parent it, you are parenting it as Humanoidrootpart… maybe parent it to workspace first.

Also i need to add this video:

It has another problem which is that it deletes for some reason after some secs

i will try that, wait a second

Sorry im on mobile too. . . . .

Actually it’s working:

But it’s very laggy. how do i solve that??