How do I disable inter-character but enable intra-character collisions for an arbitrary number of characters, with total limb count possibly exceeding 32?
Is there a workaround for the opposite of NoCollisionConstraint?
How do I disable inter-character but enable intra-character collisions for an arbitrary number of characters, with total limb count possibly exceeding 32?
Is there a workaround for the opposite of NoCollisionConstraint?
I guess you could
local collisionGroupName = player.Name.."_character"
game:GetService("PhysicsService"):RegisterCollisionGroup(collisionGroupName)
characterCollisionGroups[player.Name] = collisionGroupName
CollisionGroupSetCollidable to disable collisionsgame:GetService("PhysicsService"):CollisionGroupSetCollidable(collisionGroupName, otherCharacterCollisionGroup, false)
game:GetService("PhysicsService"):CollisionGroupSetCollidable(collisionGroupName, collisionGroupName, true)
limb.CollisionGroup = collisionGroupName
You can set collision groups on the server, and then assign them on individual clients. So your nocollision group would be assigned on the client when they spawn, but for everyone else they would be the default collision group.
I forgot to say this, but, I want to mention that I am aiming to apply this to a number of characters that may exceed 32 (NPC & player character interactions).
How would I scalably make NPC characters pass through other characters while having limb collisions within themselves?
Am I missing something? Isn’t there a limit to how many CollisionGroups can be registered?
“I forgot to say this, but, I want to mention that I am aiming to apply this to a number of characters that may exceed 32 (NPC & player character interactions).”
I missed that detail .. Maybe not.
It might be a bit inefficient, but you could just enable both inter- and intra-collisions, and then usage NoCollisionConstraints to disable inter-character collisions.
It would require a massive amount of instances however, which is obviously a pretty big downside.
Create 2 collision groups:
LocalPlayerOtherPlayerLocalPlayer can collide with LocalPlayer
LocalPlayer cannot collide with OtherPlayer
OtherPlayer may be able to collide with OtherPlayer depending on whether or not you want npcs to be collidable with one another
Set NPC and each player’s character collision group to “OtherPlayer” on the server
Set the localplayer’s character collision group to “LocalPlayer” on the client
When making the localplayer’s limbs collide with the localplayer, set the limbs’ collision groups to localplayer and if needed use NoCollisionConstraints where necessary
yeah pmuch this is the answer
Do you mean while having limb collisions with themselves?
Oh yeah typo mb, I’ll edit that
I was going to try this, thanks for the suggestion. It still won’t work for NPCs though
Didn’t know it’d be possible
Should NPCs be able to collide with other NPCs?
No, and I’ll restate my problem for anyone still keeping up with this thread:
I define characters here to be any physical model representing an NPC or a player’s character
With that said, I want:
I didn’t know that setting collision groups on each client was possible, so thanks for that info. Despite that, I don’t think this will work for disabling collisions between NPC models while preserving collisions between the limbs of any NPC in a scalable manner.
I was considering this complete suggestion, but I am thinking of making a main plaza that involves a potentially great number of characters (NPCs + players). If someone else knows of any neat (and cleaner) tricks I could pull to achieve both the (1) and (2) specifications, that’d be nice.
Dude ![]()
![]()
It would work for disabling collisions between NPC models, you just have to make another collision group for them. The logic is the same
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.