[SOLVED] How to Make Semi-Collision Work Correctly in a Multiplayer Game?

EDITOR : https://playcanvas.com/editor/scene/848105

I was making a two-player game with my friend, but the collision only allowed one player to go above the platform and the other player being stuck below, how do i fix this?

What I want is to make it so that one player can go above the platform and then stand on it, while the other player can do the same on the same platform.

You should be able to jump to the through the platform to get to the top.

I’m not sure what you are trying to achieve? Can you give some more details please?

I have updated the the text to make it more understandable, tell me if you need anymore details.

We are trying to achieve semi collision with multiple players in the same scene. Basically if either player is above the platform, the platform’s collision is enabled. That’s how the old script worked. The only problem is that if one player has already activated a platform, another player will be blocked since the collision is activated. We want the other player to be able to jump through the platform even when another player is on it and colliding with it. Is there a way we can achieve this?

This is very tricky to do as the bullet physics (and most other) engines don’t have native support for this.

The way I would consider doing this is to have a trigger below the platform that if the player enters from below and Y velocity is positive, I remove the platform physics layer from the player. Once the player leaves the trigger, I would put back the physics layer for the platforms.

Physics layers aren’t natively supported by PlayCanvas so you would have to write custom code to support this.

1 Like

The problem has been solved by @BloodStorm0606.