can someone tell me why this happens?
when i drag the object to collide with a solid wall it disappears.
both objects are solid.
It's because the paddle has 8-Direction behavior, and objects with 8-Direction behavior can't overlap Solid objects. It doesn't actually disappear, it jumps to the left or right edge of the wall.
If you want to limit the movement of your paddle, you should use an event like this:
Paddle is dragging -> Paddle set Y to clamp(self.y, 100, 600)
i tried and it works but if i enable the 8 direction (up & down) it still does it,sure i can disable the 8 direction but i want it ,mostly for testing(because i can't use to mice).
8 direction and drag don't go together?
Develop games in your browser. Powerful, performant & highly capable.
They can work together if you are not using them both at the same time, or if you are not dragging your paddle over any solid sprites.
You can add another event - if paddle is dragging, disable 8direction, else enable 8direction
if paddle is dragging, disable 8direction, else enable 8direction
i was just going to edit my last reply when i saw your answer.
thanks for the fast response!
in fact i fixed it by clamping the x too.
so i don't need to disable the 8 dir. :)