Compares if two objects refer to a different object.
var target : Transform; function Update () { // the target object does not refer to the same object as our transform if (target != transform) { print("Another object"); } }
using UnityEngine;
public class Example : MonoBehaviour { Transform target; void Update() { // the target object does not refer to the same object as our transform if (target != transform) { print("Another object"); } } }