"Custom" Collision Shapes??

maurygramsmaurygrams Member, BASIC Posts: 6
edited January 2016 in Working with GS (Mac)

So i had a bullet collide with a monster. The bullet would send its x and y to the monster and the monster would then check if the bullets position was in the monster, if the bullet was in the monster the bullet would do its animation and delete itself. i did this because the monster had a lot of empty space in its image. So that worked alright. But when i shot and the bullet passed monster(a)'s blank space and hit monster(b) If i then shot monster(b) monster(a)'s life would go down and if i shot monster(a), monster(b)'s life would go down. What was happening? is there a better way to do this? other than just trimming down the image. it might be worth noting that the monsters were both the same actor and both spawned by the same actor. sorry if i posted this in the wrong spot.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    I'm not sure I understand what's going on. Can you post a picture/video of what's happening? It's hard for me to read your post and understand your issue.

    Moved thread to appropriate category.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    That happens becuase you are using an X and Y value and your range of distance is too wide. The empty space is being acknowledged as in the hit zone. Show a picture of your monster. Did you use a custom collision shape?

  • ArmellineArmelline Member, PRO Posts: 5,368

    We need to see the images and the logic you're using, really. The more information you give the more helpful the responses will be!

  • maurygramsmaurygrams Member, BASIC Posts: 6

    i suck at explaining things but maybe this picture will help. I tried making the X and Y value range narrower but it still happens and no i'm not using a custom collision shape. I doubt anyone knows what's happening but it's worth a try. This is happening to me even when i don't restrict the X and Y, and i used the regular shape of the image. When a bullet skins the top of an actor image (by like half a pixel) and hits another actor image behind it, it switches they're health. I suggest you guys try it. Maybe a problem with GS?

  • ArmellineArmelline Member, PRO Posts: 5,368

    In your picture the bullet is clearly hitting first zombie, so the zombie's life is expected to go down. What is it you're expecting to happen?

  • maurygramsmaurygrams Member, BASIC Posts: 6
    edited January 2016

    I made it so the bullet only hits it if its Y is lower than the zombies Y+20. So no its not hitting but it is colliding. (the bullet is suppose to be going over the top)

  • ArmellineArmelline Member, PRO Posts: 5,368

    @maurygrams said:
    I made it so the bullet only hits it if its Y is lower than the zombies Y+20. So no its not hitting but it is colliding. (the bullet is suppose to be going over the top)

    We really need to see your logic.

  • maurygramsmaurygrams Member, BASIC Posts: 6

    Actually i should be asking if an actor that is spawned can effect attributes in a different instance that is also spawned? if so how can i make it so they don't effect each others attributes?

  • ArmellineArmelline Member, PRO Posts: 5,368

    @maurygrams said:
    Actually i should be asking if an actor that is spawned can effect attributes in a different instance that is also spawned? if so how can i make it so they don't effect each others attributes?

    Potentially yes, but in this case it shouldn't.

    How are you calculating the zombie's Y location? If you're spawning the zombies, it will be very difficult to get the bullet to correctly ascertain the Y location of the specific zombie it is attacking.

    You're unlikely to get a solution without showing us the actual logic you're using, though.

  • maurygramsmaurygrams Member, BASIC Posts: 6

    Well i'm actually not using that logic anymore I ended up changing the image size itself to include as little of the empty space as possible. But i still get the problem of zombies taking damage for different zombies when i hit one then switch targets to another zombie. know how to fix that?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited January 2016

    @maurygrams said:
    Well i'm actually not using that logic anymore I ended up changing the image size itself to include as little of the empty space as possible. But i still get the problem of zombies taking damage for different zombies when i hit one then switch targets to another zombie. know how to fix that?

    How can we answer that without know how exactly you coded it? Why does the image need to be so big? Is there an animation where the zombie image goes into that area? Why aren't you using a custom collision shape?

  • ArmellineArmelline Member, PRO Posts: 5,368

    @maurygrams said:
    But i still get the problem of zombies taking damage for different zombies when i hit one then switch targets to another zombie. know how to fix that?

    Well, we'll need to see the logic you're using for that then. You could have done any of a thousand things and may have caused the problem any of a thousand ways.

  • maurygramsmaurygrams Member, BASIC Posts: 6

    Alright just never mind Ill figure it out myself. Thanks for the help.

Sign In or Register to comment.