Actor falls though moving platform

dwibredwibre Member Posts: 192
edited September 2012 in Working with GS (Mac)
I have a platform that moves up and down. My actor travels up and down on it and can still move and jump as it should. My problem is I have a bug when the actor is on the moving platform and i keep pressing jump repeatedly sometime after jumping the actor falls though the platform. Any Ideas how to stop this?

Comments

  • dwibredwibre Member Posts: 192
    edited September 2012
    See Below for code

  • dwibredwibre Member Posts: 192
    edited September 2012
    Code for jump is as follows

    Rule
    When Attribute game.jump is true
    Change attribute game.jumped to true
    Change attribute game.jumpcount to self.jumpcount+1

    Rule
    When self.jumpCount <3 Run to compleation, Change attribute self.motion.linear velocity to 400

    Otherwise:
    When Attribute self.jumpcount >1
    Timer after 3 seconds "run to completion
    Change Attribute self.jumpcount to 0

    Rule
    When Actor recieves event overlaps or collides with actor with tag platform
    Change Attribute game.jumped to false
    Change Attribute self.JumpCount to 0
  • dwibredwibre Member Posts: 192
    edited September 2012
    Will the can the code not keep up while the platform is moving.
  • dwibredwibre Member Posts: 192
    To test I made the platform not moveable and it is ok. So the problem is only when the platform moves. And Ideas anyone??
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Three was a similar thread several months ago. The issue was caused by screen wrapping. By any chance, do you have screen wrapping turned on?
  • dwibredwibre Member Posts: 192
    No, no screen wrapping
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    OK -- by any chance is the platform moving up (and the actor moving down) so fast that they go past each other before before the collision can register?
  • dwibredwibre Member Posts: 192
    Yes my Hero actor had acceleration downwards of 1000. platform is moving up and down. But how can i solve this?

    Thanks for the replys btw
  • RacetotheMoonRacetotheMoon Member Posts: 323
    I had this problem in my game Doodle Ball Fall. Was never able to find a solution.
  • dwibredwibre Member Posts: 192
    What did you do for a work around @RacetotheMoon
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited September 2012
    Instead of trusting collision detection -- how about testing both actors' relative position on the Y axis. Something like:

    When (Actor1.Y - Platform.Y) < 50, then change attribute self.motion.linear velocity.Y to 400.
  • RacetotheMoonRacetotheMoon Member Posts: 323
    There was no workaround.. it's still an issue.

    I remember trying to get extra collision in there, but that only made the performance worse. Honestly, I just don't think GS is capable.
  • joshuawildejoshuawilde Member Posts: 96
    edited September 2012
    Argh, ( @saladstraightshooter look at my pirate talk) does the actor on the platform move slowly through like its struggling or does it just move like it wasnt even there. I may have a way to solve this that I did in my current game but I need to know what it does when it is on the platform
  • dwibredwibre Member Posts: 192
    @joshuawilde It falls straight though as if it wasnt there
  • joshuawildejoshuawilde Member Posts: 96
    WEIRD...try moving it by changing the x and y axis and constraining the linear velocity x, linear velocity y, and the angular velocity to 0...that should work (at least it worked for me)
  • dwibredwibre Member Posts: 192
    To close post this is how I fixed it. I made the platform size thicker and slowed the platform this game to code more time to register. Now it is working perfectly.
Sign In or Register to comment.