Skip to main content
Discovery icon for Official Unity Discord Discord server

Official Unity Discord

32,909 Online
140,022 Members
# πŸ’»β”ƒcode-beginner5 people

2D vectors and damage scripts

Vector3 handles depth and transforms in 2D games, while damage architecture splits dealing and receiving damage across attacker and receiver scripts.

  • Vector3 is used in 2D games when setting transforms or managing depth, as cameras require objects to sit in front to render
  • Unity sorts 2D sprites deterministically using sorting layer, sorting order, and sorting axis rather than relying solely on physical Z-depth
  • When designing damage systems, the attacker calls a method to deal damage while the receiver contains the method to process incoming damage and modify health
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App