How do I fix a collision issue?

0 favourites
  • 11 posts
  • 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

  • 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.

  • Appreciate the response but unfortunately this didnt work

    Thanks anyway!

  • -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.

    [attachment=0:24fuppzk][/attachment:24fuppzk]

  • I'll provide a video of what actually happens (if youtube embedding is allowed on here). Gimme a couple mins .

    Thanks for the help!

  • 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

  • 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:

    [attachment=0:1t7ohwjm][/attachment:1t7ohwjm]

  • 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.

  • This can happen when your animation has frames with different collision polygons.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Update: PROBLEM APPEARS TO BE SOLVED

    Not sure how but this seems to of fixed it: [attachment=0:12d0ntmt][/attachment:12d0ntmt]

    Basically i added a completely different edge marker for the right hand side, and added a seperate sub event for the variable changes on collision detection.

    Thankyou all so much for your input and help with this issue

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)