---It's a while wait() because of how badly it interacts with framerate changes

while wait(0.2) do
	
	---Activating/Dezactivating the mobile controls
	if script.Parent.Parent.Parent:FindFirstChild("TouchGui") then
		script.Parent.Parent.Parent["TouchGui"].Enabled = false
		script.Parent.Parent.MobileControls.Visible = true
		script.Parent.Parent.PCHandbrake.Visible = false
	else
		script.Parent.Parent.MobileControls.Visible = false
		script.Parent.Parent.PCHandbrake.Visible = true
	end
	
	if Humanoid.SeatPart ~= nil and Humanoid.SeatPart.Parent:FindFirstChild("Stats") then

		local Cached_Magnitude = Char.Head.Velocity.magnitude
		---Camera shake on collision
		--if Old_Magnitude ~= nil then
		--	print(Cached_Magnitude)
		--	print(Old_Magnitude)
		--	print(Cached_Magnitude - Old_Magnitude)
		--	print("__")
		--end	

		if Old_Magnitude ~= nil and Cached_Magnitude - Old_Magnitude < -70 then
			--print("Collision")
			--Sound
			--game.SoundService.CrashSound:Play(0.1)

			-- Explosion shake:
			--camShake:Shake(CameraShaker.Presets.Explosion)
		end
		Old_Magnitude = Cached_Magnitude
	end
end
