How to make an object an individual?

So i have a square image… “square.png” and its spawning on the sides of the screen… there’s 10 boxes on the screen at one time… when i tap the box its supposed to remove it… but since its the same image for the box when i press one box that box and several other get removed … i only want on box to get removed on press… how do i make the image an individual(individual as in like the same image but make it look like a different image in the code… does that make sense?) for every time spawned? is that possible?

NOTE: This is only an example i dont have code for this example to give you… thanks for any help!

Hi @SonicX278,

Are you familiar with the concept of “touch propagation”? Meaning, how a single touch does (or doesn’t) pass through one object back to other objects behind it? If you need a refresh on this topic, see this guide, in specific the part about adding “return true” to the touch listener to prevent propagation.

https://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Brent

Thanks! this actually might be what i need ill have to look into it as soon as i have time!

Anyways, thanks for the help @Brent i figured out what i needed to do 

local onCollision = function(self,event) if event.phase == "began" then local collide = self.value local other = event.other.value if other == 1 then -- i assigned a value to my floor hence the "1" display.remove( circle[collide] ) circle[collide] = nil end end

i made [collide] the circle number value to make it know what circle is colliding so it removes that circle and only that circle… :slight_smile:

Over and Out - SonicX278

Hi @SonicX278,

Are you familiar with the concept of “touch propagation”? Meaning, how a single touch does (or doesn’t) pass through one object back to other objects behind it? If you need a refresh on this topic, see this guide, in specific the part about adding “return true” to the touch listener to prevent propagation.

https://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Brent

Thanks! this actually might be what i need ill have to look into it as soon as i have time!

Anyways, thanks for the help @Brent i figured out what i needed to do 

local onCollision = function(self,event) if event.phase == "began" then local collide = self.value local other = event.other.value if other == 1 then -- i assigned a value to my floor hence the "1" display.remove( circle[collide] ) circle[collide] = nil end end

i made [collide] the circle number value to make it know what circle is colliding so it removes that circle and only that circle… :slight_smile:

Over and Out - SonicX278