Jump to content

Get Id of object in group


Recommended Posts


I'm using an overlap between player (joueur) and bottles (bouteilles). bottles is a group of 4 bottle and I want to know which bottle I'm interacting with in the function called by the overlap 


then the function 

function interragitb(joueur,bouteille){
	cursors = game.input.keyboard.createCursorKeys();
	if (cursors.up.isDown && points > 0)
    	bouteille.frame = bouteille.frame +1;

and I want to increment a variable to know how many times I interracted with a spécific bottle how should I do ? Is there any way to get index in the group or var name ?


Thank you

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...