Problem with collision and move at random direction

prajpraj Member Posts: 68
edited July 2012 in Working with GS (Mac)
It might probably have to do with velocity but here is my prob.-

When my object (ball) collides into a invisible wall, it should bounce off and continue up till it hits something at the top, destroys it ca returns back down. But sometimes (really sometimes after few side wall collisions), it starts going in the opposite direction. Meaning lets say it hits right wall and bounces to left wall. it some times comes back down instead of continuing up which completly ruins the game experience.

Answers

  • prajpraj Member Posts: 68
    i gave the ball random velocity 250,290 at speed 100. relative to scene.

    If conidtion valid. - attribute-self.motion.linear.velocity.y >-20

    - attribute-self.motion.linear.velocity.y <20

    then collide with bounceable object, change attribute self.motion.linear.velocity.y to random(70,120)*(-1)^(random(1,2))
  • AcceleratedGamesAcceleratedGames Member Posts: 201
    edited July 2012
    The collide behavior automatically does the math for where the ball should go when it hits the wall. You should use that instead.
  • prajpraj Member Posts: 68
    anyone?
  • AcceleratedGamesAcceleratedGames Member Posts: 201
    anyone?
    Did I answer your question or do you need a different solution.
    If you need a different solution, I'd be happy to help.
  • prajpraj Member Posts: 68
    your answer did not work. the ball does not move at all. when i add the random direction the same problem starts all over again if not it will only go straight.
  • PBEmpirePBEmpire Member Posts: 676
    ANYONE ??? I HAVE THE SAME PROBLEM!!! I SEARCHED EVERYWHERE BUT DID NOT FIND THE SOLUTION.
Sign In or Register to comment.