Animation Collide?

I am trying to make it so when the non-transparent part of one animation hits another non-transparent of the other animation it
will do something. But when the transparent parts of animations overlap they do that.

for example this test I said when actors collide display "Hello World!" but you can see before the 3 balls reach the other 2 it displays it. Is there a way to avoid this?

Best Answers

  • tatiangtatiang Posts: 11,949
    Accepted Answer

    Collisions in GameSalad are based on actor shape and collision shape (which can be set to "rectangle" or "circle"). The actual image has no effect on collisions. It doesn't matter if your 200x50 pixel actor is a 200x50 pixel blue rectangle or a 10x10 pixel yellow square. It still has a collision size of 200x50.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Posts: 12,822
    edited February 2015 Accepted Answer

    @Cowuniverse said:
    for example this test I said when actors collide display "Hello World!" but you can see before the 3 balls reach the other 2 it displays it. Is there a way to avoid this?

    Crop your images down so there is no transparent area around them, ideally you should do this to your original image files in an image editor (like Photoshop), but you can also do it in GameSalad if you are feeling lazy (although doing it in GameSalad means you have unused image information eating up memory/processor cycles).

Answers

  • CowuniverseCowuniverse Member, PRO Posts: 97

    "I am trying to make it so when the non-transparent part of one animation hits another non-transparent of the other animation it
    will do something." I meant that it won't do something.

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Hello @Cowuniverse,

    Well the issue is how you are coding your stuff. The stuff is working correctly for how you coded it but not how you want it. (If that makes sense) In the image you provided, it's displaying "Hello World" because you are telling it to display "Hello World" when the actor collides with another actor which is exactly what is happening. The 3 are colliding together and the 2 are colliding together.

    In your coding you need to be specific as to who collides with who and what rules to follow when colliding with specific actors.

    Hope that helps point you in the right direction. Don't want to give you the exact answer because you are close! :D

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @tatiang said:
    Collisions in GameSalad are based on actor shape and collision shape (which can be set to "rectangle" or "circle"). The actual image has no effect on collisions. It doesn't matter if your 200x50 pixel actor is a 200x50 pixel blue rectangle or a 10x10 pixel yellow square. It still has a collision size of 200x50.

    Ok I understand, so could I make an animation of a bear trap closing and when it is fully closed could I spawn an actor where the trap has closed and make that actor react with another?

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:

    thanks

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

    @Cowuniverse said:
    thanks

    Just remember that in GameSalad collisions happen between actors and not images.

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:
    Just remember that in GameSalad collisions happen between actors and not images.

    Ok, thanks

Sign In or Register to comment.