Hey y’all,
I’ve recently been making a pickup and drop script, and it’s been going well so far, expect when you press Q (which drops the part) the part will fall through the floor if the player is moving in the air. If anyone could help fix this issue, it would be greatly appreciated!
Video:
Drop script:
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
UIS.InputBegan:Connect(function(input, gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.Q then
character.GloveHandRight.pickupPartCloned.CanCollide = true
character.GloveHandRight.pickupPartCloned.pickupWeld:Destroy()
character.GloveHandRight.pickupPartCloned.CanCollide = true
character.GloveHandRight.pickupPartCloned.Size = character.GloveHandRight.pickupPartCloned.origSize.Value
character.GloveHandRight.pickupPartCloned.Parent = game.Workspace
end
end)
its hard to say but first of all your setting the canCollide to true twice (unecessary) also try moving it to the bottom of the function like this
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
UIS.InputBegan:Connect(function(input, gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.Q then
character.GloveHandRight.pickupPartCloned.pickupWeld:Destroy()
character.GloveHandRight.pickupPartCloned.Size = character.GloveHandRight.pickupPartCloned.origSize.Value
character.GloveHandRight.pickupPartCloned.Parent = game.Workspace
character.GloveHandRight.pickupPartCloned.CanCollide = true
end
end)
well assuming that “pickupPartCloned” is a model or tool sometimes you cant blanket set propertys as in tool.CanCollide = true, you might have to loop through the parts in the model and set them all to CanCollide = true (but to save hastle id just try setting the eight corners of that box to cancollide = true)
ahh right well the thing with unions is they can be funny with their hit boxes, id consider having the main bit of the model in this case your union as cancollide = false and then having a part welded to it that has cancollide to true to be its hit box in a sense then moving your (im assuming) Part.Touched script under the hitbox part.
if ^that^ didnt make sense just tell me and ill try explain better
next you want to fit a part around it so it covers it completely you want this block to have cancollide on
because it will be your models pyshics (make tthe part transparent its just translucent for you to see it)
now for the weld we will use the built in welding system click the little arrow under create
yes there are a few ways to weld all of them probably work but i just wasnt sure how familiar you were with instances ect so i tried to use the easiest method of welding being the “create instance”
if you have another prefered way of welding im sure itd work too be it a plugin ect.
well sorry if i insulted your knowledge then i just wasnt sure how much of a grasp of the studio you had or key terminology but clearly you are well imbursed with it ;p