Stop when colliding with object...

iTouchGameriTouchGamer Member Posts: 681
edited November -1 in Working with GS (Mac)
Is there a way to make an actor stop when it collides with another actor. I have searched many, many times and nothing has worked. Thanks guys!

Also, more info on this if it helps you guys-I have actors spawning randomly from top of screen, and another actor at the bottom that is moved around to try and "catch" the spawning actors, so the actors land on it.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Try this: Have a rule when actor recieves event overlaps or collides with whatever object you want

    change self motion linear x to 0

    change self motion linear y to 0

    cheers
  • iTouchGameriTouchGamer Member Posts: 681
    It works, but for only a second lol, the actor stops on the other actor, stays for 1 second, then continues down the scene.....
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    iTouchGamer said:
    It works, but for only a second lol, the actor stops on the other actor, stays for 1 second, then continues down the scene.....

    what move rules do you ahve on the objects and do you have gravity on
  • AsymptoteellAsymptoteell Member Posts: 1,362
    try constraining them to 0.
  • iTouchGameriTouchGamer Member Posts: 681
    JohnPapiomitis said:
    what move rules do you ahve on the objects and do you have gravity on

    Gravity-off
    On Spawning object-Rules:just to accelerate down and the rule you told me to add.
    Asymptoteell said:
    try constraining them to 0.

    Just tried that, but now after they reach the other actor, they start to slowly "inch" down at about .0005 mph lol.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    have a attribute called stop have it set to 0

    In your falling actor put the accelerate down behavior in a rule that says when stop =0 accelerate down

    then have another rule when the actor collides iwth whatver change stop to 1

    then have antother rule when stop =1 change attribute self motion linear x and self motion linear y to 0
    so it will only accelerate when it doesnt touch the box
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Also change some self attributes, X and Y to self position x and y, upon collision. Then constrain actor's x and y positions to x and y.
  • iTouchGameriTouchGamer Member Posts: 681
    Is this going to be an integer??
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah interger.

    Keep this in mind that if no drags applied to a actor it will continure to accelerate to it reaches top speed,

    so if you do what i said and it still inches down real slow, replace the change attribute behaviors for selp motoin linear x and y to constrains

    Try the first way first though
    cheers
  • iTouchGameriTouchGamer Member Posts: 681
    I don't know what's wrong guys....

    I did what you said and here's what happened:

    Objects started spawning regularly, when the first one collided, it went straight through, then all of the other actors spawning went at a slower speed....
  • youngster9youngster9 Member Posts: 326
    I had the same type of problem I still haven't fixed it and my game is almost ready to be released.
  • iTouchGameriTouchGamer Member Posts: 681
    Yea, I just ran into this problem, but I don't wanna go any further until it's solved.....
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    you need to constrain the linear velocity x and y to 0 GS doesn't do a good job in completely stopping objects that have been moving in my experience.
    ___________________________________________________________________________________
    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    AppSolute Entertainment on Facebook
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah did u try the second option i gave you, which is constraing to 0 like tenrdrmer just mentioned

    if u still cant get it i can take a look at it if youd like

    my email is papiomitis@yahoo.com
  • iTouchGameriTouchGamer Member Posts: 681
    Yea guys, I don't know if I'm doing something wrong or not, but nothings working. Ok John hold on, I'll send it over. Thanks guys for all your help!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You must have missed something I had the same issue with the reset on the BubbleBall Template. and constrain attribute instead of change attribute fixed it.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Fixed it for you and sent it back, You were missin your collide behavior all you needed was that and your accelerate behavior in a rule whne self stop =0 then change self stop to 1 when it collides with the object

    cheers
  • iTouchGameriTouchGamer Member Posts: 681
    Thanks man.
  • iTouchGameriTouchGamer Member Posts: 681
    Ok, now the hockey stick at the bottom isn't movable. Is this going to have to stay, because I want to be able to move the stick around and catch pucks.

    When I turn movable on and preview the game, when the puck hits the stick, they both fall down....
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    I didnt change anything from moveable to unmovable or anything like that, i guess u sent it non moveable by accident. Turn moveable on make the restitution on both the puck and the stick 0, and put a constrain attribute behavior in the stick and constin self position y to wahtever you want

    cheers
  • iTouchGameriTouchGamer Member Posts: 681
    Well, the stick is moving back and forth, so what do I constrain it to?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Your constraing the y position to whatever position it is on screen, so it will move left and right but not fall down. Click the stick thats on screen, when it opens dont unlock it, just go to the left to its attributes go to position and whatever the y position is is the number you put iin the constrain behavior
  • iTouchGameriTouchGamer Member Posts: 681
    Ok, got that. Now when the puck lands on the side of the stick, it starts to tilt up, then fall.

    I hate calling out to you guys and complaining lol, makes me feel like I'm annoying all of you.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Did you change the restition in physics attributs on both the puck and stick to 0

    and if its the stick thats tilting check fixed rotation in its physics attribute
  • iTouchGameriTouchGamer Member Posts: 681
    Both restition set to 0.....

    Fixed rotation fixed it, but now.....

    The pucks are hopping up and down after they hit the stick.....
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    dont know what u did, i relized i still had your project on my desktop so i constrained the y position and check fixed rotation like i told you to do and it works perfect. Ill send it to you if you want
  • iTouchGameriTouchGamer Member Posts: 681
    Yes please lol, I want to see if there are any differences between the one I have and the one you're sending me. Thanks!
Sign In or Register to comment.