No Overlap, only Collide?

TigrisLiTigrisLi Member Posts: 19
edited January 2012 in Working with GS (Mac)
Hi!

I was wondering when: Actor receives event, that there's only a collide and no overlap instead of overlap & collide with actor of type...?
But it doesn't destroy the actor.
Thanks!

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    The condition is "Overlap or Collide" so its either or. If you have collisions set then it will only collide and never overlap. Not sure what your issue is. Maybe you can explain more about what you are trying to do.
  • TigrisLiTigrisLi Member Posts: 19
    edited January 2012
    In the game I'm making, I have to jump over vehicles and and if I don't jump and collide the image will change, but when I jump over them it touches the cars and it changes the image.

    What I would like is, when my actor jumps over a car, the image won't change, only when it hits the car, the image will change.
    thanks!
  • MotherHooseMotherHoose Member Posts: 2,456
    @TigrisLi … might help:

    in your playerActor and in your carActors > AttributesPane > Physics> Collision Shape and chose Circle

    this should stop the computer from processing the clipping of square's corner edges of the images … as collision/overlap

    @};- MH
  • TigrisLiTigrisLi Member Posts: 19
    it doesn't work!
    But thanks for your help!
    My actors are coming from up to down so, I don't know how to figure this out
  • MotherHooseMotherHoose Member Posts: 2,456
    very hard to visualize this one @TigrisLi

    can you upload your project???

    @};- MH
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited January 2012
    You're going to have to set up attributes that say while you are in the air, to turn off collision detection between the two actors, and when he lands on the ground, another attribute that turns collisions back on again, so if you don't jump, you get hit.
  • TigrisLiTigrisLi Member Posts: 19
    Great!

    Could you, if possible, give a little more detailed version please! @SlickZero

    Thanks you very much
  • MotherHooseMotherHoose Member Posts: 2,456
    good one! @SlickZero

    I have been playing too many platformers for this one ... 8-

    @};- MH
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited January 2012
    You will need a couple different custom game attributes for this, both booleans. We'll call the first one "jump" and the second one "collide" for the sake of this example.

    In your button that makes the actor jump, have another behavior in the "when touch is pressed" section that basically adds this - TIMER for 1 second change attribute.jump to "true"
    then in the "otherwise" section - change attribute.jump to "false"

    Then inside your main jumping actor, have a rule for the collision that says - When attribute.collide is "true" then drop in your collide behaviors for the vehicle. And then have another rule that says - when attribute.jump = "true" - TIMER for 1 second change attribute.collide to "false" and check the "run to completion" box.
    then in the "otherwise" section - change attribute.collide to "true"

    What that will do is set the collision to false for 1 second, giving you time to clear the vehicle before the collisions turn back on. You can adjust the timers to whatever works best for the situation.

    Hope that makes sense.

    And thank you, MotherHoose :)
  • TigrisLiTigrisLi Member Posts: 19
    Thanks!
    It works! But now I can jump over the vehicles, when I jump, it drags the main actor down.... :(
    Thanks a lot, you really helped me! :)
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited January 2012
    You may have to play around with the timers to get it to work just right. And make sure you have all the right collision behaviors inside the rule that turns them off and on. Like the collision between the car and the actor definitely need to be in there.
  • TigrisLiTigrisLi Member Posts: 19
    ok great thanks again!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited January 2012
    My pleasure. Let me know if it works out. :)
  • TigrisLiTigrisLi Member Posts: 19
    edited January 2012
    well, I tried changing the timers, but it doesn't quit work, when I jump, the other actors are like walls that are dragging them down
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    You'll have to put all the collide behaviors in there then. I don't know how your rules and game are set up exactly, but anything that collides with the main actor needs to be turned off during the time the actor is jumping in the air.
  • TigrisLiTigrisLi Member Posts: 19
    Here's my project file... http://tinyurl.com/7o5cyz9
    If you could check it out, if you want to and have time, I would really appreciate it!
    Thanks!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    File doesn't seem to be downloading to me for some reason. You can zip it in a file and email it to me if you'd like.

    chrisATmcguiremultimedia.com
  • TigrisLiTigrisLi Member Posts: 19
    Hi! I fixed it!!
    just had to play a bit more with the timers!
    thanks you soo much for your help!!!
    And thanks for the quick replies!!

    Tigris :D
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Awesome! Glad you got it working.

    And it was my pleasure :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Always nice to see someone get it working on their own. I think in the end its the most rewarding thing and you learn the most from working out a usable solution on your own.

Sign In or Register to comment.