Skip to content

Instantly share code, notes, and snippets.

@Sevaarcen
Created January 26, 2024 22:02
Show Gist options
  • Save Sevaarcen/821fc856790ad22a794eb75f8f4882b3 to your computer and use it in GitHub Desktop.
Save Sevaarcen/821fc856790ad22a794eb75f8f4882b3 to your computer and use it in GitHub Desktop.
FoundryVTT - Target Selected Tokens (Universal)
// unset all current targets
for (const t of game.user.targets) {
t.setTarget(false, {user: game.user, releaseOthers: false, groupSelection: false})
}
// Set all controlled tokens to be targeted
for (const controlled of canvas.tokens.controlled) {
controlled.setTarget(true, {user: game.user, releaseOthers: false, groupSelection: false})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment