Help needed with collision/overlap

yuttuy3yuttuy3 Member, PRO Posts: 17
edited July 2015 in Working with GS (PC)

Hi,

I can't figure out how to do this. can someone help?
Case: Imagine two circular actors flying to eachother.
A collision will happen when the outer parts of the circles touches. But i want them to 'collide' when they overlap for at least for 50%. Is there a way to do this?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited July 2015

    Use Magnitude to check how far away they are from each other, if you don't know how to use magnitude use the search bar top right.

    If your circles are both 100 pixels you can check to see if magnitude is ≤ 50 before you do your magic.

  • yuttuy3yuttuy3 Member, PRO Posts: 17

    @DeepBlueApps Thanks you for the suggestion.
    It seems to be the option I was looking for.

    Seached and found the answer given by Socks:
    Magnitude gives you this distance between two actors (in any direction) and it works like this: the distance between A and B . . .

    nummeric expression: magnitude(B.position.x-A.position.x, B.position.y-A.position.y)

Sign In or Register to comment.