Collision Problem causing me to move

I’m working on a prop hunt game, my plan is that when you change into a prop, everything in the character apart from the Prop that you’re hiding as cannot collide with the map so that what happens in the gif below doesn’t happen.

PhysicsService:CollisionGroupSetCollidable("Hiders", "Default", false)

for _, Object in pairs(Character:GetDescendants()) do
	if Object:IsA("BasePart") then
		if Object.Name ~= "Prop" then
			PhysicsService:SetPartCollisionGroup(Object, "Hiders")
		end
	end
end

--Code I use to weld the prop
local Prop = Props[Prop]:Clone()
Prop.Name = "Prop"
local Weld = Instance.new("Motor6D")
Weld.Part0 = Character.HumanoidRootPart
Weld.Part1 = Prop
Weld.C0 = CFrame.new(0, (-2.35 + Prop.Size.Y/2),0)
Weld.Parent = Prop
Prop.Parent = Character

That’s my code, but for some reason it does what you see in the gif below.

I weld the Prop to the HumanoidRootPart if that’s relevant and I’ve tried making the prop massless but it doesn’t help at all.

I’m extremely stumped and I have no idea how to fix this, any ideas?

Try getting humanoid.HipHeight to the right value. It appears the character is falling into the paper, pushing it down and causing pysics to be confused.

1 Like

Is there a way to automate it?

It’ll be extremely hard to have to guess the hip height for each prop in my game.

Are you using a Weld or a Motor6D? Motor6D is what you should be using to weld your paper to the HumanoidRootPart. If you are then you should take a look at the parts in your character and look at their collision group ids to make sure they’re right.

It’s a Motor6D, I believe @REALTimothy0812 is correct and I need to adjust the hip height though I’m not sure how to automate it as I don’t think it’s productive to try and figure out what the hip height should be for each prop in my game.

Updated post to include my welding code.

It’s the fact that the part is under the character model. Put your prop somewhere else instead of there and it would be fixed.

That fixed the problem thanks, though I’m still floating which I can’t fix which also means I can’t jump.

Do you know how hard it is to create a custom jump function that acts the same as the default jump?

Just tested, I also can’t go up wedges for some reason.

Here’s how you automate it

Interestingly when I was trying to create a working version of what you have, I stumbled upon a bug:

Basically it works exactly as you wanted it to, except unfortunately it doesn’t respect collisions for the bottom part if I jump or fall when colliding (16s in vid). I’ll probably file a bug report about it but if you’re still determined with using Humanoids then you might have to do something about your original character. I would create a “prop character” and create that / destroy your previous character as soon as you try to switch characters.

Edit: It’s very brief but at 5s in the vid you can see that the bottom right part interacts with my floor piece, meaning I do have collision with it, just not if I’m walking.

Edit2: To fix the jumping, I just made the HRP not collide with default. This however does mean you have to make a “floor” collider for the HRP’s new collision group to interact with.

The HRP doesn’t collide with Default as it’s in the Hiders collision group so I’m not sure why it’s acting differently for me.

How do you change the character for the player during a live game? Is it just Player.Character = NewModel?

I have mine set up differently. You need to set up a “Floor” collision group for your HRP to stand on. You need it to do that for physics to interact with the part, otherwise it’s always in freefall.

And yeah it’s essentially that. You need a Humanoid and a primary part for the model as well if you’re continuing that route.

I’ll try the new character method because that seems like it would be the best way to go about it imo as it means I won’t have to deal with a ton of collision groups, thanks for the help!

1 Like

I guess I’ll need to figure out how to automate the hip height for each prop though. I’m guessing it’s not as simple as just being HipHeight = Prop.Size.Y

You don’t need to worry about hip height if your root part is the model’s extent size.

Alright, thanks!