GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make a third actor move when two other actors collide?

Dell7730Dell7730 Posts: 388Member, PRO

When Actor 1 collides with or overlaps Actor 2, then Actor 3 reacts, mainly Actor 3 Move To Actor 1 or 2. I hope that's clear enough for anyone to understand.

Best Answer

Answers

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

    @dellagarpo said:
    When Actor 1 collides with or overlaps Actor 2, then Actor 3 reacts.

    When actor1 collides with actor2 change game.attribute to true

    When game.attribute is true make actor3 react.

  • Dell7730Dell7730 Posts: 388Member, PRO

    Can you please show a demo or sample? Thanks.

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

    @dellagarpo said:
    Can you please show a demo or sample? Thanks.

    It's very straightforward, which part are you having problems with ?

  • Dell7730Dell7730 Posts: 388Member, PRO

    @Socks said:
    It's very straightforward, which part are you having problems with ?

    Haven't gotten sleep for almost 3 days now so I can't think straight, lol

    I have no problem having 2 actors interact how ever way I want, making a third one get involve is new to me, especially turning an attribute to true or whatever like how you said, lol

    thanks for the time though, really do appreciate it...

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

    @dellagarpo said:
    . . . turning an attribute to true or whatever like how you said, lol

    It is as simple as . . . When actor1 collides with actor2 change game.attribute to true

  • Dell7730Dell7730 Posts: 388Member, PRO

    @Socks said:
    It is as simple as . . . When actor1 collides with actor2 change game.attribute to true

    I forgot to tell you, just started messing with Gamesalad and coding less than a week ago so I'm totally oblivious to what you're saying when it's not shown to me in like a whole paragraph or so, lol

    hope you're not getting frustrated at me as I am with my problem, lol

  • Dell7730Dell7730 Posts: 388Member, PRO
    edited March 2015

    @Socks said:
    It is as simple as . . . When actor1 collides with actor2 change game.attribute to true

    after getting rid of hangover and fully rested, I finally got it to work, thanks to you... hope you can help me with another one in regards to this problem..

    the first initial contact of actor 1 and actor 2 it WORKED, but when trying it again several times after, actor 3 won't respond anymore. I would like actor 3 to react every time actor 1 and 2 collides.

    looking forward to your help and thanks very much

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

    @dellagarpo said:
    the first initial contact of actor 1 and actor 2 it WORKED, but when trying it again several times after, actor 3 won't respond anymore. I would like actor 3 to react every time actor 1 and 2 collides

    Can we see your rules ?

  • Dell7730Dell7730 Posts: 388Member, PRO

    @Socks said:
    Can we see your rules ?

    Inside Actor 3:
    Created a Boolean named MouseLoc
    if self.MouseLoc is true
    move to: game.Actor1.position.x, game.Actor1.position.y

    Inside Actor 1:
    when Actor 1 collides or overlaps with Actor 2
    Change Attribute Actor3.MouseLoc to true

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

    @dellagarpo said:

    Can you please show a screenshot ?

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

    I give up.

  • Dell7730Dell7730 Posts: 388Member, PRO

    lol why?

  • SocksSocks London, UK.Posts: 12,822Member
    edited March 2015

    @dellagarpo said:
    lol why?

    Lack of the will to live :wink:

    The rule you posted indicates that if an attribute is true then the actor will move to some position (which you have kept hidden). It's not really much use to be honest, the only way to make the screenshot less useful would have been to somehow cover over the name of the attribute, then the information blackout would have been complete :smiley:

    Hold on, I feel a Photoshop image approaching . . . .

    EDIT: There you go, this image coveys no information.

  • Dell7730Dell7730 Posts: 388Member, PRO

    @Socks said:

    So......... how's your weekend going? lol

  • SLOCM3ZSLOCM3Z Posts: 797Member

    Do you know constrain attribute?

  • SLOCM3ZSLOCM3Z Posts: 797Member

    Nope not constrain. Sorry. @Socks was trying to say make a new attribute in game called 'whatever you want.boolean'. Then when actor 1 collides with actor 2 have one of them change attribute 'game.whatever you want.boolean' to true

  • SLOCM3ZSLOCM3Z Posts: 797Member

    He is the old pro but I think that is what he was trying to say before his lack of wanting to live. :lol:

  • Dell7730Dell7730 Posts: 388Member, PRO
    edited March 2015

    @jdlcrater said:
    Do you know constrain attribute?

    I Do but that's not what I want, cause I don't want Actor 3 to touch any of the first two actors, Just want Actor 3 to Move To towards. I already have that working, it's just that once Actor 1 touches Actor 2, it works one time only and won't the next times around.

  • Dell7730Dell7730 Posts: 388Member, PRO

    @jdlcrater said:
    dellagarpo I wasn't thinking clearly about that. Sorry. If you want it to happen multiple times in 'else' have the actor change attribute to false.

    I'll try that right now, I'll let you know right away, thanks.

  • Dell7730Dell7730 Posts: 388Member, PRO

    @jdlcrater said:
    dellagarpo I wasn't thinking clearly about that. Sorry. If you want it to happen multiple times in 'else' have the actor change attribute to false.

    Booyah! It Works! Thanks so so so very much!

  • SLOCM3ZSLOCM3Z Posts: 797Member

    Your welcome. :smile:

  • Dell7730Dell7730 Posts: 388Member, PRO

    @jdlcrater said:
    He is the old pro but I think that is what he was trying to say before his lack of wanting to live. :lol:

    hahahaha

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

    @dellagarpo said:
    So......... how's your weekend going? lol

    So far so good, it's been pretty straightforward, except for Saturday which was weird.

  • Dell7730Dell7730 Posts: 388Member, PRO

    @Socks said:
    So far so good, it's been pretty straightforward, except for Saturday which was weird.

    Great, at least you're not lacking the will to live lol

  • PhilipCCPhilipCC Encounter Bay, South AustraliaPosts: 1,390Member

    That's what I love about this forum... all those who have a sense of humour and make me chuckle. :D

Sign In or Register to comment.