How can I make a part have two body velocities without one overlapping the other?

Hi devforum, I made a part that when touched, it inserts two velocities, as shown below:

local debounce = false

script.Parent.Touched:Connect(function(hit)
	if game.Players:GetPlayerFromCharacter(hit.Parent) then
		if not debounce then
			debounce = true
			local bv1 = Instance.new("BodyVelocity")
			bv1.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			bv1.P = 100
			bv1.Velocity = hit.Parent.HumanoidRootPart.CFrame.LookVector * 100
			
			local bv2 = Instance.new("BodyVelocity")
			bv2.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			bv2.P = 100
			bv2.Velocity = hit.Parent.HumanoidRootPart.CFrame.UpVector * 100
			
			bv1.Parent = script.Parent
			bv2.Parent = script.Parent
		end
	end
end)

I noticed how when I run this script, one body velocity “overlaps” the other. I mean how when touched, it either only goes the LookVector direction, or UpVector direction while having both velocities.

My goal is to make it so that it both goes the LookVector and UpVector direction, and after a little amount of time, it falls smoothly, but not rapidly.

Add the directional vectors together. Use one body velocity

1 Like

Just add both velocities together and put the new value in the body velocity

2 Likes

Thanks for both of the replies. It did work, thank you for that. Is there a possible way to make it fall smoothly instead of rapidly like when you destroy the body velocity?

For something like this. I personally think its better to manually control the force using a VectorForce object. Then you can reduce the values manually or possibly with a tween.

Edit: You could also look into using ApplyImpulse() method although it wouldn’t reduce the fall speed, the fall speed would be dependent on the gravity/physics.

Thank you for the reply, I’ll try it