Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.
How do I…
Hi I need help to stop the object, I use swipe up gesture to make the object move up, and when the object hits a wall then object will destroy and go back to the default position.
I found that code in the gdev tutorial on YouTube that’s how they create a broken object animation, I tried the normal collision but it did not work so I used physics collision
Unless you are using physics behaviours on both objects, the physics collision is the wrong one to use. And even if you do have physics behaviour on it, you don’t change a physics objects position by increasing it’s position values.
But, back to your issue. The swipe direction condition is the direction of the last swipe. You need to add a “Swipe has just ended” condition when there is a swipe direction condition.
A friend said before that you should not use physics on objects. If both objects do not use physics.
I would do this. But that’s how I understand the problem. Because the solution, for me, is so simple that I am sure that I have misunderstood your problem.
I would change “change y position…” to “move to object new tiled sprite …” with permanent force.
I would change: When the " block_up" object collides with “new tiled sprite”…THEN…Destroy the object and create a new “block_up” object in the position you want.