Problem with collision and move at random direction
![praj](https://images.v-cdn.net/banned_large.png)
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.
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
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))
If you need a different solution, I'd be happy to help.