Change boolean while colliding

tutysestutyses Member Posts: 134
edited January 2012 in Working with GS (Mac)
Hello everyone, i m trying to make an actor (Metal) to change his self attribute "electricity" when its colliding with the actor "Generator" . I put a rule on the metal actor, it says when colliding with generator change attribute electricity to true, otherwise change it to false, but it does not work , its always false, if i erase the otherwise it change to true when it collides but it doesnt go back to false, any ideas ?

Comments

  • tutysestutyses Member Posts: 134
    Please, really needing help on this
  • calvin9403calvin9403 Member Posts: 3,186
    when overlaps or collide with Generator and attribute is false change it to true
    when overlaps or collide with Generator and attribute is true change it to false

    hope this helps

    Calvin
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    that will just mean every other touch will flip the switch

    the actors could be colliding and bouncing off each other, so maybe they hit and quickly disconnect. change restitution to 0 on both so they don't bounce away from each other
    then its only true when its in contact, but false when its not touching
  • calvin9403calvin9403 Member Posts: 3,186
    @Tutyses what do you excently want, have it flip all the time or not?
  • tutysestutyses Member Posts: 134
    I managed to make it work in a complicated way, then i read morphinegamingmachine post, and he was right, it was the restitution :P
    Calvin, the metal actor should detect if its colliding with another object with electricity, in this case the generator, so the boolean must be OFf, when its Not colliding or when its colliding but the other object has the electricity boolean in false
    Is there another way to detect the other object boolean than puting all the actors unlocked, to be able to acces the other actors boolean?
  • calvin9403calvin9403 Member Posts: 3,186


    Do this

    When they collide then you have to change an attribute(make one global attribute and then make it a Boolean too) to actor's attrbute . Then u can use the global one to see if the other object's boolean value
  • tutysestutyses Member Posts: 134
    You mean, creating a global attribute FOR EACH metal i have on the screen right?
  • calvin9403calvin9403 Member Posts: 3,186
    no, just use that one if you won't overlaps with more then one metal at a time
  • tutysestutyses Member Posts: 134
    The metal can collide with another one which is not charged with electricity, and if there is another one which is charged, it would activate the rule, its not possible to do that
  • calvin9403calvin9403 Member Posts: 3,186
    ok then just do what I said
  • tutysestutyses Member Posts: 134
    It wont work, it will colide with more than one object
  • calvin9403calvin9403 Member Posts: 3,186
    ok then you have to make a lot of attributes

    I wish we have writeable tables
  • tutysestutyses Member Posts: 134
    me too ! :p
Sign In or Register to comment.