Change the size of a collision box?

Hi all I've spent the good part of my evening searching through the cookbook,videos, and other tutorials.

My question is how do I add custom collision shapes to an actor? I have a character who is animating on a sprite but I only want his legs and body to collide with my other objects in the scene... his arms are out to the side and i cant figure out how to make a smaller collision box. I have provided an Image as well to demonstrate what Im trying to do.

photo CollisionExplanation.jpg

Thanks in advance.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Make a smaller box and constrain it to the main character.

  • ookami007ookami007 Member Posts: 581

    Create a small, transparent actor. Do all action to this actor (collision checks, movement, etc).

    constrain that actor's x,y to two game attributes (say playerX,playerY)

    Now, create your image actor and constrain it's x and y to the game.playerX and game.playerY you created above.

    What this does is basically puts the image actor overtop of the bounding box actor.

    You may need another global variable to tell the image actor what animation to play if you have more than one animation - ie. game.action = moveright, game.action = jump

    Then, in the image, test for those conditions and play the appropriate animation or change to the appropriate image

  • rpanimatorrpanimator Member Posts: 2

    Thanks a ton! I will try these solutions. :) Will game salad ever have the ability to just adjust the hit box for an actor similar to the way unity 3d can?

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    @rpanimator said:
    Thanks a ton! I will try these solutions. :) Will game salad ever have the ability to just adjust the hit box for an actor similar to the way unity 3d can?

    Who knows !? Maybe one day ? But even without a built-in ability to adjust the hit box size it's fairly straightforward to do using a secondary actor (or even a series of actors for more complex collision shapes).

Sign In or Register to comment.