Throwing wont work

  1. What do you want to achieve? Keep it simple and clear!
    I wanted to make the can fly while throwing but instead it just falls.

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Handle = script.Parent
local HitDebounce = false
Handle.Weld:Destroy()
-- This is part that wont work
Handle.SodaFly.P = 1250
Handle.SodaFly.Velocity = Vector3.new(Handle.ThrowTo.WorldCFrame.X-Handle.Throw.WorldCFrame.X,0,Handle.ThrowTo.WorldCFrame.Z-Handle.Throw.WorldCFrame.Z)
print(Handle.Throw.WorldCFrame.LookVector.X)
print(Handle.Throw.WorldCFrame.LookVector.Z)
-- This is part that wont work
game.TweenService:Create(Handle.SodaFly,TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{P = 0}):Play()

Handle.Touched:Connect(function(Hit)
	if HitDebounce == false then
		HitDebounce = true
		if Hit.Parent:FindFirstChildOfClass("Humanoid") then
			if (Handle.Velocity.X + Handle.Velocity.Z) >= 20 then
				local Ball = Instance.new("Part",workspace.Game.Debris)
				Ball.Shape = Enum.PartType.Ball
				Ball.Anchored = true
				Ball.CanCollide = false
				Ball.Color = Color3.new(1,1,1)
				Ball.Size = Vector3.new(0,0,0)
				Ball.Position = Handle.Position
				game.TweenService:Create(Ball,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = Vector3.new(2,2,2),Transparency = 1}):Play()
				Hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(35)
			else
				Hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(15)
			end
		else
			if (Handle.Velocity.X + Handle.Velocity.Z) >= 20 then
				local Ball = Instance.new("Part",workspace.Game.Debris)
				Ball.Shape = Enum.PartType.Ball
				Ball.Anchored = true
				Ball.CanCollide = false
				Ball.Color = Color3.new(1,1,1)
				Ball.Size = Vector3.new(0,0,0)
				Ball.Position = Handle.Position
				game.TweenService:Create(Ball,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = Vector3.new(2,2,2),Transparency = 1}):Play()
			else
				
			end
		end
	end
end)

Handle.CanTouch = false
Handle.CanCollide = false
wait(0.5)
Handle.CanTouch = true
Handle.CanCollide = true

Try using :ApplyImpulse() instead

i dont even know how this works.
will it work on Body Velocity?

Apply impulse is a function, it can be used in any BasePart, Mesh, etc.

You could use it like: Handle.SodaFly:ApplyImpulse(force)

image

i want to make it on bod velocity

welp. im gonna wait 100 more years until another answer…

You shouldn’t and i don’t recommend working with it as body velocity is deprecated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.