Say I had CollisionGroup1, CollisionGroup2, and CollisionGroup3:
I want CollisionGroup2 to be able to push CollisionGroup1 but when CollisionGroup3 tries to push CollisionGroup1 it won’t be able to.
Can I anchor a part exclusively for a specific collision group and have it unachored for others or do I have to try something “hacky”?
I suppose locally anchoring parts could be a viable alternative, any suggestions on the collision groups however?
As far as I know from looking at the
PhysicsService | Documentation - Roblox Creator Hub API, there is not a way to set whether a collision group can “push” or otherwise interact with physics along with another group. I believe you should write your own code for this based on the CollectionService | Documentation - Roblox Creator Hub and go from there.
I played around a bit, and I found something that may be a bit hacky, but might be good enough for your use case.
You can change a part’s CustomPhysicalProperties to make it impossible for a player to push. If you do this on the clients those you don’t want to push certain parts, everyone else would be able to push the parts instead of those specific clients.
-- PhysicalProperties.new(Density, Friction, Elasticity)
Part.CustomPhysicalProperties = PhysicalProperties.new(math.huge,math.huge,0)
You can have a fake hitbox. So basically they will feel it is impossible to push without actually affecting the real object. Here is the solution’s post.
I saw multiple topics regarding making npcs not collideable when they don’t move but I want my npc to move while players cannot push or push any force towards them.
So the npc moves freely without getting interruped but players can’t walk trough! That’s important.
Thanks, that is really smart actually. Daniel’s solution was good too but yours, I believe, would be optimal.