-
Overlapping Problem
I've got a bunch of bullets being fired. Each is using a custom movement (made with events). I loop through each one, then I loop through them again to move them one pixel at a time, but 20 pixels per frame. To detect a hit, during the second loop, I check for collisions on the zombies. The conditions look like:
- On loop "BulletSteps"
- Fixed value of "Bullet" equal to value("BulletBeingMoved")
- Bullet is overlapping a zombie
That event never fires. I tried deleting the overlapping one, and it fires, but with it, it never fires. (I also tried switching the two objects around, that didn't work).
What's going on?
-
Re: Overlapping Problem
I also had a problem like this. At the start of the frame try to create bullets on all zombies at the same time. So all zombies overlap a bullet and vice versa. It's strange but it worked for me.
-
Re: Overlapping Problem
Uhhh, why would I do that? I want the player to have to shoot them, not have it shoot them at the beginning of the frame.
-
Re: Overlapping Problem
Does changing the event to zombie overlaps bullet work?
-
Re: Overlapping Problem
I don't remember for sure, but i think events like collision or overlapping are only tested before the main loop, not inside. Maybe i'm wrong but i think that if you set an object over another one, the "overlapping" condition can only be met at the next loop. You should maybe test this.
-
Re: Overlapping Problem
Yea, I've tried switching them.
After the loop eh? Would it do the same thing if I use the looping feature in an extension?
I'm really starting to hate the built in looping in MMF2...
-
Re: Overlapping Problem
I've never had a problem with detecting collisions within fastloops... I'm not entirely sure what Corentin means.
I think the old "Post up an example" idea might be best.
-
Re: Overlapping Problem
I can't test it right now but here's a test :
Start of frame :
-Start loop "test" 1 time
On loop "test"
-Set Object1 at 0,0 from Object2
On loop "test"
+Object1 overlaps Object2
-play sample "beep"
I think it won't beep because the overlapping isn't tested during the condition but before he main loop (when they aren't overlapping).
Sorry, I know it's quite a bad explanation, my poor English is giving me troubles.
-
Re: Overlapping Problem
Yes, Corentin, I had this problem with MMF1.5
If I remember well, you can't create an object and check for collision in the same loop.
-
Re: Overlapping Problem
I'm not creating objects in the same loop. I'll try to get an example file made, though, with my luck, the example file will work just fine...