reverse gravity on contact with an actor?

I'm making a platforming game and I want to have my actor have his gravity reversed on contact with another actor. Any help would be appreciated.

Comments

  • DuesDues Member Posts: 1,159
    edited April 2015

    Instead of using gravity in your scene, use the accelerate behaviour. That way you can switch direction based on a rule (eg. colliding with another object) and create your own gravity :)

  • stellathefellastellathefella Member Posts: 20

    I have it set to accelerate in direction 270 with 900 accel and when it hits the reverse gravity actor I have it set to accelerate in direction 90 with 900 accel. I doesnt reverse the gravity on contact.

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

    @stellathefella said:
    I doesnt reverse the gravity on contact.

    Can you say what does happen ?

  • stellathefellastellathefella Member Posts: 20

    nothing for some strange reason.

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

    @stellathefella said:
    nothing . .

    Can you be more specific, answers like 'nothing' to questions like 'what happens' aren't much use when attempting to resolve an issue, I'm trying to find out what does happen, 'nothing happens' could mean lots of things, it could mean the actor just continues passed the reverse gravity actor, the reverse gravity actor has no effect on it at all, nothing happens, it could mean the actor collides with the reverse gravity actor but just stops, it doesn't go into reverse, 'nothing happens', it could even mean the actor just bounces off in some arbitrary direction seemingly unaffected by the reverse gravity rule and so on . . . . Regardless of what does or doesn't happen can you say what this actually looks like on screen, are you able to describe the result of the interaction, even if it is just 'the actor just slows down over 1-2 seconds and eventually stops' or 'the actor stops suddenly' or 'the actor just continues passed the reverse gravity actor' ?

  • stellathefellastellathefella Member Posts: 20

    he passes through the actor as if nothing happened.

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

    @stellathefella said:
    he passes through the actor as if nothing happened.

    Ok, so the actor continues moving in the direction he was going in originally (before overlapping the reverse gravity actor) . . . could you post a screenshot of your rules, I think that would help track down the issue.

  • stellathefellastellathefella Member Posts: 20

    http://tinypic.com/view.php?pic=rr2rtk&s=8#.VTA4tiHBzRY
    http://tinypic.com/view.php?pic=5zl1zr&s=8#.VTA45yHBzRY
    those are the rules for the moving actor, the the gravity reversing actor.

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

    @stellathefella said:
    those are the rules for the moving actor, the the gravity reversing actor.

    The two accelerate behaviours need to be in the same actor.

  • stellathefellastellathefella Member Posts: 20

    *not the. woops.

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

    @stellathefella said:
    *not the. woops.

    The two accelerate behaviours need to be in the actor that is moving (not the reverse gravity actor).

  • stellathefellastellathefella Member Posts: 20

    They are on the same actor but he still passes through the other actor with his gravity being reversed.

  • SummationSummation Member, PRO Posts: 476

    @stellathefella Do you have a Collide, bounce when colliding with actor of type

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

    @stellathefella said:
    They are on the same actor but he still passes through the other actor with his gravity being reversed.

    Can we see the rules you are now using ? In the first of the two screenshots above, what is the constrain behaviour doing ?

  • SummationSummation Member, PRO Posts: 476

    @Socks said:
    Can we see the rules you are now using ? In the first of the two screenshots above, what is the constrain behaviour doing ?

    I think his actor may not be colliding with that reverse gravity portal in order to trigger it...?

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

    @Summation said:
    I think his actor may not be colliding with that reverse gravity portal in order to trigger it...?

    It's hard to tell but I suspect the rule that looks for collision is in the wrong actor, but it's really hard to tell without being able to peer into the various rules and behaviours to see what they are doing.

  • SummationSummation Member, PRO Posts: 476

    @Socks said:
    It's hard to tell but I suspect the rule that looks for collision is in the wrong actor, but it's really hard to tell without being able to peer into the various rules and behaviours to see what they are doing.

    Time to practice that clairvoyance skill I left in an old RPG...

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

    @Summation said:
    Time to practice that clairvoyance skill I left in an old RPG...

    I knew you were going to say that.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited April 2015

    I think the problem is that in the first screenshot you have the accelerate behavior outside any rule, so your actor is alway accelerating down at speed 900. So if you collide with the actor that should change gravity and have your actor accelerate up at speed of 900, those two cancel each other...

    I don´t think i explained this very well, but i made a very (very) quick demo for you. (attached)

    Check it out and tell me if it is anything like the thing you´re trying to achieve.

    EDIT: Damn... Just realized you use the windows version...

    In a nutshell:

    -Make a game attribute and call it something like "ChangeGravity"
    -Make a rule in the actor that says
    -When game.ChangeGravity is false, accelerate 270, speed 900
    -Otherwise accelerate 90, at speed 900

    -Make another rule that says
    -When collides with actor 'ReverseGravity'
    -Change Attribute 'game.ChangeGravity to true'

    Mental Donkey Games
    Website - Facebook - Twitter

Sign In or Register to comment.