How do I pass a object between players by passing them?

I’m starting to work on a PvP game where whoever is holding a stick the longest wins.

My issue is that I’m having a problem getting the stick to go to the other player when they pass each other. When player 2 has the stick player 1 can’t steal it back. This is a platformer by the way.

Here is the code I have so far.

Any help is much appreciated. Thanks!

Have you tried just triggering once the onPlayer booleans? I think what is happening is the stick is in collision with Player(x) so when you want to set the boolean to false to pass the stick, it sets it back to true right away because right now, it just sets it to true all the time while in collision. Hope that helps :slight_smile:

That didn’t really work.

Nevermind I fixed it. Thanks for pointing me in the right direction.

1 Like