How do I fix a collision issue?

Get help using Construct 2

Post » Thu Apr 10, 2014 11:57 am

Good afternoon all,

Here is my problem: I have an enemy walking across a platform, when it hits the edge marker, it turns round and walks back and vise versa. However, when i place enemy #2 on that same platform with the same events/actions (except tailored to enemy #2) - it acknowledges the collision is it briefly flips round but then flips back to its original path and moves through the edge marker.

This is seriously baffling me as 1 enemy works fine, but im having trouble getting this 2nd to stay on >.<

Here is 2 images, one of the event sheet and 1 of the layout.

http://www.dropbox.com/s/zb61imhz7u1u6av/screen1.png
http://www.dropbox.com/s/5wo3c2634swar2x/screen.png

Hope someone can help :)
Many thanks,
moymoymoy
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Thu Apr 10, 2014 1:52 pm

You probably need a 'For each' before event 37, then move 37 and 38 as a subevent of it. That will ensure you are picking one at a time and moving each correctly.
ImageImageImage
B
71
S
22
G
248
Posts: 3,759
Reputation: 138,069

Post » Wed Apr 16, 2014 1:12 pm

Appreciate the response but unfortunately this didnt work :(

Thanks anyway!
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Apr 16, 2014 1:38 pm

-snip-
Well I'm confused. Here's a working one, no idea why it does work, since it's pretty much the same as yours.
Also I tested it with a string, just like yours, and it still worked, so I'm not sure what it is.
AIPatrol.capx
You do not have the required permissions to view the files attached to this post.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Apr 16, 2014 2:02 pm

I'll provide a video of what actually happens (if youtube embedding is allowed on here). Gimme a couple mins :) .
Thanks for the help!
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Apr 16, 2014 2:21 pm

Its worth noting that firstly a) holy hell this screen recording software is laggy, b) when the enemy hits the right marker it DOES flip for one frame then continues off the side of the platform, c) i have a second enemy using the same events but with its own variable and it works fine.

Here is the video, sorry for the quality :)

http://youtu.be/BpZYEwIaRo0
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Apr 16, 2014 2:37 pm

Ah, now you mention it try putting a system>for each at the top like hornet suggested, and have all the "Forest Cow Movement" events under it. I tried the original one with two objects just then and it did something similar to yours. It seems else has problems with instances.
Example:
AIPatrol.capx
You do not have the required permissions to view the files attached to this post.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Apr 16, 2014 4:05 pm

Hahahaha that got me a funny result. I did exactly as you have in the capx file and 2 new problems occured:

1) my main character falls through platforms
2) the "Forest Cow" bounced off the right marker but went straight through the left and falling to his death

I very much appreciate your input here btw, if i could buy you a drink or snack of your choosing as a thanks then i would.
B
11
S
2
G
1
Posts: 62
Reputation: 1,410

Post » Wed Apr 16, 2014 5:40 pm

This can happen when your animation has frames with different collision polygons.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Thu Apr 17, 2014 2:10 am

@moymoymoy
Well damn. Good luck, and ramones right, same thing with image points.
I guess if the animation changed just after it collided it could think that it was not overlapping and thus able to collide again. Also, you really should add a text box for debug so you can work out what is happening. Something like append "collided " to it when it collides. If it shows "collided collided " then you know it was the animations problem like ramones suggested, otherwise... Good luck!

Also I really don't know why your character is falling through platforms, that should be completely separate from the Forest Cow events, so unless you had that for each for everything in the project I'm not sure what's going on there, but I'm pretty sure it's not the for each.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Next

Return to How do I....?

Who is online

Users browsing this forum: TheCrazyPrince and 18 guests