Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make part move with BodyVelocity ?

I create a ball, i want to player hold it about 3 seconds then throw follow mouse. I use bodyvelocity but it not work when i add wait(3) in. The ball will fall down. This is my script :

game.ReplicatedStorage.Events.FireC.OnServerEvent:Connect(function(player,mousePos)
	local dmg = 50
	local character = player.Character
	local cre = character.Name
    	local effects = game.ReplicatedStorage.Fire
 	local fireBall = effects.FireTichQuaCau:Clone()
	fireBall.dmg.Value = dmg
	fireBall.creator.Value = cre
	fireBall.CFrame = character.HumanoidRootPart.CFrame + Vector3.new(0,50,0) --set position
	fireBall.Anchored = true --anchored to wait 3 senconds
		fireBall.Parent = workspace
	local velocity = Instance.new("BodyVelocity", fireBall)
	wait(3) 
	fireBall.Anchored = false -- false anchored to throw
	velocity.Velocity = CFrame.new(fireBall.Position, mousePos).LookVector*100
end)

2 answers

I really don't know how to do it myself, but you can check out this video, I think that's exactly what you want. I already tested it and it worked perfectly

1 comment

0

I can do like that but when i add command wait(3). It does not work

I fixed it, the problem is not with the wait command. I have to increase maxForce for it

This discussion is preserved as it was. New answers, comments, and votes are closed.