Can you compare transforms like that to check if an object moved, scaled or rotated?
Or do I have to specifically check?
aGameObject.transform.position != bGameObject.transform.position
Can you compare transforms like that to check if an object moved, scaled or rotated?
Or do I have to specifically check?
aGameObject.transform.position != bGameObject.transform.position
You need to check for specific changes. If you use transform == transform
it will check to see if the transforms are the same transform component, not the individual properties of them.
Also keep in mind that if you say Transform a = someGameObject.transform
and then somewhere else say someGameObject.transform.position = Vector3.zero
then a.position
will also equal the new Vector3.zero
since the variable a
points to the same Transform component as someGameObject.transform