How do I make the edge marker work properly?

Get help using Construct 2

Post » Fri Apr 24, 2015 8:06 am

Please add "dropbox.com" before the below link and paste it in your browser to download the project.
/s/n33d56pczkh9f29/Test.capx?dl=0
I want this sprite to change direction when it hits the edge marker. It works but sometimes it automatically ignores the edge marker and falls off the platform. :? Please help me figure out how to fix this. :roll:
B
4
Posts: 10
Reputation: 222

Post » Fri Apr 24, 2015 8:49 am

@manav2018

Hasn't this already been dealt with here https://www.scirra.com/forum/viewtopic.php?f=152&t=129207&p=909143#p909143 ?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,480
Reputation: 59,746

Post » Fri Apr 24, 2015 9:41 am

@zenox98

No, that was a different problem. At that time, the sprite got stuck in the middle of the platform and your suggestion helped me fix it. But this time, the sprite sometimes falls off the platform without colliding with the edge marker and changing its direction.
B
4
Posts: 10
Reputation: 222

Post » Fri Apr 24, 2015 10:20 am

Ok.

It could be that the animation frames of your enemy sprite are not uniform size. If you run in debug you can see that when the collision marker is collided with and your sprite is animating, then it triggers the change of the 'IsLeft' instance variable more than once. Hence, it looks like a bug and not colliding, but it is working correctly.

If you look at Ashley's platform tutorial, you'll see he advocates using a uniform sized invisible dummy sprite that has the behaviors assigned to it, and the animations are just then pinned to it. That way, collisions should trigger exactly, and not get confused by the animations.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,480
Reputation: 59,746

Post » Fri Apr 24, 2015 2:58 pm

@zenox98
Thank You so much for helping it is working quite well now!
B
4
Posts: 10
Reputation: 222


Return to How do I....?

Who is online

Users browsing this forum: AllanR, plinkie, Yahoo [Bot] and 7 guests