Skip to content

Instantly share code, notes, and snippets.

@hobione2k
Last active September 28, 2023 17:20
Show Gist options
  • Save hobione2k/89971cf5f4a934da520ae80880f183fa to your computer and use it in GitHub Desktop.
Save hobione2k/89971cf5f4a934da520ae80880f183fa to your computer and use it in GitHub Desktop.
ClusterScript Beta subNode比較
const equalNode = (n1, n2) =>
n1.getGlobalPosition().equals(n2.getGlobalPosition()) &&
n1.getGlobalRotation().equals(n2.getGlobalRotation());
@hobione2k
Copy link
Author

使い方

const col1 = $.subNode("Col1");
const overlaps = $.getOverlaps();
  overlaps.forEach((overlap) => {
    if (equalNode(overlap.selfNode, col1)) log(`Hit col1`); // Col1 subNodeに当たった。
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment