smdu57 Posted May 4, 2017 Share Posted May 4, 2017 Hello 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 game.physics.arcade.overlap(joueur,bouteilles,interragitb,null,this); then the function function interragitb(joueur,bouteille){ cursors = game.input.keyboard.createCursorKeys(); if (cursors.up.isDown && points > 0) { bouteille.frame = bouteille.frame +1; point(0); } } 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 More sharing options...
smdu57 Posted May 5, 2017 Author Share Posted May 5, 2017 I found, I just had to set object name on creation then with a switch case I can do what I want Link to comment Share on other sites More sharing options...
Recommended Posts