A problem with new instances V1.03.2

Bugs will be moved here once resolved.

Post » Mon Sep 17, 2012 12:28 am

Hi Ashley,

New instances are behaving strangely, sprite collides with sprite5 and if you wait till the middle counter reaches the number 12 you can see it also disables the collision of new instances when it shouldn't since the collide variable is false for new instances.

I also used to be able to just disable behaviors by using the "start of layout event" however as you can see it no longer works. It works for already existing instances but not new ones, as if you disable the "start of layout event" you can see the bullet behavior working.

I think these 2 problems are related.

Here is the capx.

http://dl.dropbox.com/u/57137706/col3.capx

Kind Regards

RockmanZero2012-09-17 00:29:33
B
25
S
161
G
3
Posts: 51
Reputation: 18,702

Post » Mon Sep 17, 2012 2:45 pm

This project appears to be working correctly. I'm not sure what you're expecting to happen instead? It is useful to provide .capxs which are as minimal as possible, so any events or objects not directly related to the problem are removed.

By the way, if you spawn objects inside (overlapping) other objects, you should not expect the result to be realistic either, since this is an impossible physical phenomenon.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Mon Sep 17, 2012 3:28 pm

Hi Ashley,

Basically I'm trying to make something similar to a jumpthru without using the platformer behavior, when the collide variable is false collision should be on between sprite and sprite5. New instances automatically have the collide variable as false. Which should mean that the collision between sprite and sprite5 is on.

Here 2 capx hopefully this explains it better. I've left the text objects so you can see the variables between the objects.

The only difference between the 2 capx is that I moved the sprite object above sprite 4 to another position in collide2.capx.

http://dl.dropbox.com/u/57137706/collide1.capx
http://dl.dropbox.com/u/57137706/collide2.capx

In collide1. The new instances should not be going through sprite5 since the variable is set to false.

Basically when the variable on one instance is set to true it is disabling the collision for all new instances. All existing instances work correctly though.




@Ashely
Here this might explain it best.

http://dl.dropbox.com/u/57137706/collide3.capx

press z - (collision works correctly)
now click on one of the instances of sprite on the bottom so it jumps up. (Still working correctly)
now press x - new instance goes through sprite5 when it shouldn't.






RockmanZero2012-09-17 16:03:43
B
25
S
161
G
3
Posts: 51
Reputation: 18,702

Post » Mon Sep 17, 2012 5:36 pm

I'm afraid I don't think this can be fixed - it's a limitation of the physics engine that only entire object types can disable collisions between each other, not individual instances. So 'disable collisions' will affect all instances at once.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Mon Sep 17, 2012 5:53 pm

@Ashely
But Ashley it's not disabling them all, its only disabling the new created instances any existing instances still works correctly. If you look at the instance above sprite5 then you can see it still functions with collision after its been disabled. But since it can't be fixed is there any workaround for a custom jumpthru per instance.
B
25
S
161
G
3
Posts: 51
Reputation: 18,702


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests