How do i make the hitbox for an actor smaller?

So basically in this game i am making, you have to avoid blocks that come at you. I want to make the hitbox for the character smaller. I want the hitbox to be about 2 x smaller than the characters image size. how would i accomplish this?
thanks

Comments

  • JarrenHJarrenH Member Posts: 206
    The easiest way would be to constrain a second actor that is smaller to the position of the character. You could then set up a global attribute that fires off to the main character when the second actor is hit. All you have to do is set the alpha of the hit box to 0 and it will be invisible.
  • Asobu_GamesAsobu_Games PRO Posts: 261
    Depending on the shape of your character you might need a few different invisible hitboxes constrained to different parts of the main character. Also Make sure to consider whether you want them to be rectangular or circular hitboxes.
  • ORBZORBZ Member Posts: 1,304
    edited May 2013
    The easiest way is to use a circle collision shape on your actor instead of rectangle and then make the actor non-square (width != height). The hitbox will be a circle with a diameter equal to the smallest side: width OR height. This means that the longer side will have some area that is not covered by the collision area. This saves the extra CPU cycles needed for constraining collision actors. Plus has the benefit of working with physics collision data, i.e. your actor will respond to physics.
Sign In or Register to comment.