Why the ball dosen't move?

I tried calculating a Vector Force by a Direction variable, I want it to go straight were the HumanoidRootPart is looking. Here is the code:

local direction = (humanoidRootPart.CFrame.LookVector * 5) 

If someone needs here is full code

	local function DestroyConstraints(char)
			if char:FindFirstChild("Bubble") then
				local bubble = char:FindFirstChild("Bubble")
				for _, constraint in ipairs(bubble:GetChildren()) do
					if constraint:IsA("WeldConstraint") then
						constraint:Destroy()
					end
				end
			end
		end

		local bubbleTemplate = game.ServerStorage.Bubble
		if bubbleTemplate then
			local bubble = bubbleTemplate:Clone()
			local TweenService = game:GetService("TweenService")
			bubble.Parent = workspace
			bubble.CFrame = char.HumanoidRootPart.CFrame + Vector3.new(1,0,0)
			Hum:LoadAnimation(script.Bubble):Play()
			local tween = TweenService:Create(bubble,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0),{Size = Vector3.new(7.212, 7.212, 7.212)})
			tween:Play()
			tween.Completed:Connect(function()
				local force = Instance.new("VectorForce")
				local humanoidRootPart = char:WaitForChild("HumanoidRootPart")
				local direction = (humanoidRootPart.CFrame.LookVector * 5) 
				force.Force = direction / 2.6
				force.RelativeTo = Enum.ActuatorRelativeTo.World
				force.Parent = bubble

				local attachment = Instance.new("Attachment")
				attachment.Parent = bubble
				attachment.Position = bubble.Position
				force.Attachment0 = attachment
			end)

			local touchconn 
			touchconn = bubble.Touched:Connect(function(hit)
				if hit.Parent and hit.Parent ~= char and hit.Parent:FindFirstChild("Humanoid") then 
					local WeldConstraint = Instance.new("WeldConstraint")
					WeldConstraint.Parent = bubble
					WeldConstraint.Part0 = bubble
					WeldConstraint.Part1 = hit.Parent.Torso
					bubble.Parent = hit.Parent
				end
			end)

			wait(10)
			DestroyConstraints(char)
			touchconn:Disconnect()
			bubble:Destroy()
		else
			warn("Bubble template not found.")
		end
2 Likes

why not use a bodyvelocity? you can use the direction for the velocity and it will work perfectly fine

I didn’t Use it beacause it’s depreacted but i will try

I’m absolutely terrible at math but maybe try multiplying by Vector3(5, 5, 5) instead of jsut 5

Or well wait I’m dumb

ok i will try it right now! Thanks for response

Wait don’t I just realized that’s not gonna work lol

ServerScriptService.MainScripts.AbilityHandler:520: attempt to call a table value, U know fix?

Yeah I messed up on that too. It should be Vector3.new but either way I messed up on the math so it wouldn’t matter

Oh, any other fix???
THE CHARACTER LIMIT

Hm maybe work with a different body mover like you could use AlignPosition

Or you could apply manually velocity with ApplyImpulse (prolly shouldn’t tho)

And maybe apply AssemblyLinearVelocity which is a property btw

I’ll get some links if you need me to

Ok I will try using them, but i think the error is on the direction variable cuz it need to spawn infront but i will try out some of those too!

1 Like

Your equation should actually probably work fine so yeah I guess just experiment

After testing i found out that when u are on a diferent position of the map the velocity changes when u are more on the X so if u are on like 100 x it will go faster than if u are on like 20 x is there any fix??

1 Like

I suspect that the LookVector is changing based on your position. Although I’m not sure if this is true or not soo

Anyways uh I’m not sure sorry

1 Like

Do u know any fix?? If yes pls tell it, also the player has weird movement

1 Like