compsci-godot-arpg/ch01/lesson-12.org
2024-09-11 15:42:46 +03:00

1.5 KiB

Lesson 12: Player-Enemy Collisions

< Back to Main TOC

Notes

add collision shape to enemy sprite

  • add CollisionShape2D to sprite root

add shape

  • select collision shape 2D node from Scene Panel
  • Go to Inspector->CollisionShape2D->Shape
  • select 'CapsuleShape2D' from dropdown

modify shape

  • Go to Inspector->CollisionShape2D->Node2D
  • Open 'Transform'
  • Go to Rotation and set to 90 degrees
  • Modify shape via handles to adjust it over sprite

z-index

  • set :w