Part glitching through baseplate

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)

-Thanks!

I have no Idea but I hope this get solved asap.

1 Like

is it just exclusively in the air or is it when you are on the floor too?

2 Likes

I’ve tested lots and doesn’t seem to happen on floor.

1 Like

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)
1 Like

Makes it fall straight through the base plate :slightly_frowning_face:

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)

1 Like

Actually, it’s not a mode. It is a union, but I tested the same script on a regular plain part and got the same result.

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

1 Like

So basically make a shell that can collide?

that is exactly what i mean so also on a side itd be easier for the game to process i believe

if you want me to guide you on how to do that id be more than happy.

1 Like

That would be really great thanks!

alright so say this is your model.
image
set it to can collide off

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)
image

now for the weld we will use the built in welding system click the little arrow under create


and then select weld

you will then select your union and the “shell” to weld them together

i would also recommend grouping these together

then move the scripts that were under the union into the shell because that is the part players will be touching if they stand on the model

3 Likes

you are also going to need to re-adjust your script a bit after this so if you need help with that too feel free to ask.

1 Like

Thanks so much! This works perfectly :grin:

no problem at all always glad to help :+1:

1 Like

One question: A weld constraint is basically the same thing as a weld right?

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.

1 Like

Instances are like the easiest haha

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

1 Like