Destuctionable model with a certain amount of Velocity

What do you want to achieve?
I want to make that when you hit a model in a certain Velocity it will unanchor.

What is the issue?
I am trying to get so it can be more then for example 2 in Velocity
but I keep getting this error "Workspace.Street Lamp.MeshPart.Script:3: attempt to compare Vector3 < number"

The Code

script.Parent.Touched:Connect(function(hit)
	print("HIT")
	if hit.Velocity <= 1 then
		print("Runned?")
			script.Parent.Anchored = false
		end
	end)

Change the script to,

script.Parent.Touched:Connect(function(hit)
	print("HIT")
	if hit.Velocity.Magnitude <= 1 then
		print("Runned?")
			script.Parent.Anchored = false
		end
	end)

hit.Velocity is a vector3 while hit.Velocity.Magnitude is a number.

I will try that, Thanks! It’s late in the night my brain is tired. lol

Thanks again

1 Like