#Collision Shape Questions

4 messages · Page 1 of 1 (latest)

daring stratus
#

Is there a way to resize a collision shape automatically based on the size of the sprite? I can do it manually for every node but would like to not and say I did, especially when sprite changing during gameplay gets involved. Like I obviously don't want a mouse turned into a dragon to keep the tiny hitbox.

Also is it possible to have a collision shape for movement/obstacles and one for getting hit by things?

jolly island
#
  1. you can use the get_rect() function on a sprite to get its dimensions, then use those to set the collision shape's size

  2. yes. you can set the collision layer and mask to tell it what to hit and what can hit it. you probably want a character body as the movement and an area for hurt box

#

or probably GetRect in C#

daring stratus