Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:45:23+00:00 2026-06-03T21:45:23+00:00

I just created a 2 player game (like ShapeGame) but the problem is when

  • 0

I just created a 2 player game (like ShapeGame) but the problem is when one of the players lefts from the game scene, I can’t detect which one (which player) left from the game.

Think that there are 2 cars in the game. First detected player (call it player1) uses left one and player2 uses right one. When player1 left the scene, suddenly player2 takes the control of left car, and if player1 rejoins the game, player1 takes back control of the left car again and player2 takes control of the right car.

int id = 0;  
foreach (SkeletonData data in skeletonFrame.Skeletons)
{
    if (SkeletonTrackingState.Tracked == data.TrackingState)
    {
        // do some work

        id++;
    }
}

The thing is program gives id = 0 for first detected player (call it player1) and 1 for second detected player (call it player2). When player2 lefts from the game and rejoins, there is no problem. It again takes id = 1. but when player1 lefts from the game, player2 takes id = 0 because of it is the first detected player at this point.

Any solutions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:45:24+00:00Added an answer on June 3, 2026 at 9:45 pm

    Every player has an index in the Skeleton array:

    void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) {
        SkeletonFrame sf = e.SkeletonFrame;
        //check which skeletons in array are active and use that array indexes for player index
        SkeletonData player1 = sf.Skeletons[playerIndex1];
        SkeletonData player2 = sf.Skeletons[playerIndex2];
    

    You can use that index to identify your players if one leave and comes back.
    But if both players leave the sight of the Kinect it is not granted that the player index is correct when they enter the Kinect visibility again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In school, one of my professors had created a 3D game (not just an
I have created enemies that chase the player around a game, but there is
Just created a WSS site with a some custom web-parts. But I get an
I just created a PHP page that spits outs some data from my database
I just created an iPhone app and am having friends try it out, but
I would like to write some simple Mario-like game from scratch using language C.
I have created a small game in Java and I would like to add
I would like to create a game where the players create differents products with
My sql database stores the highscores for the players of a game like this:
I recently created a turn-based game server that can accept 10s of thousands of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.