One-Way Part Collision

Hi all,

Is there a way to make Part A able to collide with Part B while Part B is unable to collide with Part A? How exactly can I achieve this?

Thank you in advance.

2 Likes

Set CanTouch of part B to false

Wait what???

2 Likes

As far as I know this can’t be done. If one part’s CanCollide property is set to false, then it will pass through any other parts. So for example, setting PartA’s CanCollide to false will allow it to pass through PartB, this will also allow PartB to pass through PartA.

I’m not too sure what you want to accomplish, maybe you could elaborate more.

1 Like

Do you mean if you try to move Part A through Part B it will stop, but if you try to move Part B through Part A it won’t stop?

Also, are you trying to do this in Studio, or in a game?

1 Like

If you try to move Part B through Part A, the Part A will be pushed away and the Part B won’t stop.

This is for vehicles and how latency affects car chases. I want it so the player driving a police car doesn’t get stopped (collide) upon hitting the racing car whereas if the racer car hits the police car it would collide.

1 Like

Trying to collide with a part that cannot be collided with is pretty hard for me to wrap my head around. Since the part is would not be able to collide with another group of objects (being the player racecars in this case) then it would not be possible to allow the player racecars to collide with the police cars. If a player decided to hit into the side of the police car as you described this would mean the police car would be passing through it as it is not able to collide with players.

You could try filtering collision with collision groups but as I’ve tried already still haven’t gotten a solution. Hope you find what you’re looking for though!

You’re asking your question pretty poorly here, but as far as I can tell you’d like to be able to drive through an object and have the physics engine still apply forces to that target, without your car being stopped.

You could probably disable collisions with your car on the object that you want to hit through collisiongroups, and instead handle the collision yourself with .Touched() (or any other suitable hit detection feature) and apply the forces yourself with BasePart:ApplyImpulseAtPosition(). The latency would likely be annoying, but that’s the best advice I can give here.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.