Dropped tools goes through walls

  1. What do you want to achieve? Keep it simple and clear!

I want tools that are dropped to not go through walls or at the top of the walls.

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

I made a pickup and drop script on a tool, the thing is whenever I try to drop the tool if I’m facing any wall it goes through that wall or at the top of it.

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

Have searched and done a few things but none of them worked.

This is my script, I did it so whenever you press the “E” key it drops the tool

local tool = script.Parent
local handle = tool.Handle

local remote = tool.RemoteEvent

local throwing = false

local throwSpeed = 3

remote.OnServerEvent:Connect(function(player)
	
	if throwing == true then return end
	throwing = true
	
	tool.Parent = workspace
	local cframe = handle.CFrame
	handle.CFrame = cframe

	handle:SetNetworkOwner(nil)
	
	handle.AssemblyLinearVelocity = player.Character.HumanoidRootPart.CFrame.LookVector * throwSpeed
	
	throwing = false

end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

It’s because your trying to CFrame the tool into the wall, the collision system will not allow the tool to be stuck in the wall, so it moves it outside. I would try raycasting instead, raycasting in front of you so it doesn’t cframe into the wall

Or, if you wanted an easier solution, make it fall at your feet, or maybe start inside your torso, then give it velocity that way it can’t be CFramed into a wall unless… the player is in the wall

1 Like

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