comparing objects returned by different means
How does one (if indeed this is possible) compare two objects in a project when one is (if this makes sense) the object itself, and one is returned as the child of another object?
In other words, If I have an object (let's say for the sake of simplicity, that it is a camera) which is referenced in a variable (let's say, myVar1), and I have another object contained in another variable, (let's say, myVar2), which was returned by doing
and both are the same camera, if I do:
or
Both return false.
How do we check that it is the same object?
[update:] I have figured out a way to do this, but I'd still be interested in knowing if others have messed around with this issue.
How does one (if indeed this is possible) compare two objects in a project when one is (if this makes sense) the object itself, and one is returned as the child of another object?
In other words, If I have an object (let's say for the sake of simplicity, that it is a camera) which is referenced in a variable (let's say, myVar1), and I have another object contained in another variable, (let's say, myVar2), which was returned by doing
Code:
myVar2 = parentObject.childAtIndex(0)
Code:
(myVar1 == myVar2)
Code:
(myVar1 === myVar2)
How do we check that it is the same object?
[update:] I have figured out a way to do this, but I'd still be interested in knowing if others have messed around with this issue.
Last edited: