Problem when actor collides
ganeshjiwa51
Member Posts: 12
Hi,
Im developing a game where the Hero actor moves to the position where the mouse touches on screen. I record every touched position in a table and the next time the mouse touches any other position on screen, I rewrite the table and make my Hero actor move to the new position. And this is working fine. Along the path the Hero moves, I have obstacles such as stones. I do not want my Hero to walk through it. I have the collide function to not allow the Hero to go through. But my Hero happens to be sliding up or downwards until he reaches the end of the screen when he collides with those stones.
I believe this is because the Hero is trying to move towards the touched position, and since he has collide with an obstacle, he is not able to reach that point and therefore he is sliding.
Is there a way for me to get my Hero move towards the touched position after he has move out of the obstacle he collided? in another word is to stop sliding and move to the position the mouse touched?
Thanks in advance.
Im developing a game where the Hero actor moves to the position where the mouse touches on screen. I record every touched position in a table and the next time the mouse touches any other position on screen, I rewrite the table and make my Hero actor move to the new position. And this is working fine. Along the path the Hero moves, I have obstacles such as stones. I do not want my Hero to walk through it. I have the collide function to not allow the Hero to go through. But my Hero happens to be sliding up or downwards until he reaches the end of the screen when he collides with those stones.
I believe this is because the Hero is trying to move towards the touched position, and since he has collide with an obstacle, he is not able to reach that point and therefore he is sliding.
Is there a way for me to get my Hero move towards the touched position after he has move out of the obstacle he collided? in another word is to stop sliding and move to the position the mouse touched?
Thanks in advance.
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
tatiang, i will try it out. thanks man