Actor order in layer affecting collision detection
Mekonbekon
Member Posts: 8
Hi all,
I have two actors, A and B.
Both actors are on the same layer.
On actor A I have an "if actor overlaps or collides with actor of type B change direction" rule.
Actor A is moving at around 50.
Actor B is stationary, but its width is oscillating using a sin rule.
Neither actor has a bounce collision rule - they pass through each other.
Here's the problem:
If A is below B in the layer then the rule triggers correctly, but if I reorder the actors so that A is above B then the rule doesn't trigger.
If I stop B oscillating then the rule works fine.
There is a reasonably long period of overlap (almost 1s), plenty for the condition to register.
Any ideas what is happening? Why should the order+oscillation have this effect?
Ideally I want A to be above B. Reassigning the rules to work off of B isn't really an option.
I guess I could create an invisible non-oscillating buddy for actor B and use that for the collision, but I would also like to work out why this is happening, for future reference.
As an alternative workaround, is there any way to change the order of actors within a layer on the fly, or even change the layer that the actor is on?
I'm using Windows GS.
I have two actors, A and B.
Both actors are on the same layer.
On actor A I have an "if actor overlaps or collides with actor of type B change direction" rule.
Actor A is moving at around 50.
Actor B is stationary, but its width is oscillating using a sin rule.
Neither actor has a bounce collision rule - they pass through each other.
Here's the problem:
If A is below B in the layer then the rule triggers correctly, but if I reorder the actors so that A is above B then the rule doesn't trigger.
If I stop B oscillating then the rule works fine.
There is a reasonably long period of overlap (almost 1s), plenty for the condition to register.
Any ideas what is happening? Why should the order+oscillation have this effect?
Ideally I want A to be above B. Reassigning the rules to work off of B isn't really an option.
I guess I could create an invisible non-oscillating buddy for actor B and use that for the collision, but I would also like to work out why this is happening, for future reference.
As an alternative workaround, is there any way to change the order of actors within a layer on the fly, or even change the layer that the actor is on?
I'm using Windows GS.
Answers
I just spent HOURS trying to find a bug until I found it it was this GameSalad bug again. Swell.