Determining size of collision, and grouping objects?
saxajar
Member Posts: 4
Two questions
First, is there a way to determine the size of the collion box of an entity, regardless of it's sprite size? Currently the only way I can see to do collisions is basically the size of the object, even if there is blank space around the sprite.
Second, is there a way to group sprites easily, if you want to have a layered sprite with different parts, but have it controlled as a single entity?
Thanks for the help.
First, is there a way to determine the size of the collion box of an entity, regardless of it's sprite size? Currently the only way I can see to do collisions is basically the size of the object, even if there is blank space around the sprite.
Second, is there a way to group sprites easily, if you want to have a layered sprite with different parts, but have it controlled as a single entity?
Thanks for the help.
Comments
It can be done for a single actor by creating some global variables, but that method breaks down if you spawn multiples of that actor (i.e. duplicate multi-sprite enemies).
anyone else have another method they are using?
create 2 game attributes called PlayerX and PlayerY.
Within the collision object, constrain PlayerX and PlayerY to the collision actor's X and Y.
Within the sprite, constrain its X and Y to PlayerX and PlayerY.
Your controls would control the invisible actor, not the sprite.
By doing this, you can have the collision boundaries be larger or smaller than the sprite.
I have done this and it works well.
Hope this helps!
also, could really do with a way to to rename the duplicated actor in scene and then be able to use a rule to check the other actors variables.