Prevent actors overlapping
GanjaN
Member Posts: 4
Hi,
I'm a newcomer to Gamesalad and working on a game where 2 groups of actors fight eachother, and its working okay but once they move to eachother to fight they overlap. I tried to create actors that attach to the groups and are larger than the actor himself with the collision behaviour to bounce if they collided with either the attachment or the ally/enemy. On all actors the bounciness is 0 and the attachments are immovable. For some reason that doesn't work though and they still pile up.
The movement behaviour is set with rules that if Enemy1 distance < Enemy2 distance MoveTo Enemy1 etc.
How do you basically give an invisible shield to all the actors that would block anyone from overlapping?
Comments
You could increase the actual size of the image for each actor, and just have the extra space be transparent. The file types need to be png's for this. Then, you can check for collisions and they'll "hit" before they appear to hit, because the transparent spaces are touching,
the collide rule should work
create a tag called nooverlap or something
add all actors you don't want to overlap to that tag
then put a rule that says collides with actors with tag, no overlap
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
@Adrenaline Yeah that would save me the unnecessary actors, I basically already have that "shield" on the actors but the problem is that nothing happens if they collide with anything using the collide behaviour to bounce.
@jonmulcahy What behaviour block would I use then in the rule that when they collide/overlap? Like I said I used the collide block and the bounciness is set to 0 on all but that doesn't seem to work. I'm not sure if the rule would add anything since that block already has a sort of built-in if actor collides with statement.
i think you'll need to post screenshots of your rules, I'm not sure what you are trying to do.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left