How to prevent 2 movable actors from pushing each other?

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
Hey guys ,
Im struggling with something that suppose to be easy , or is it ?!
Ill really appreciate your help or advice .

I have 2 movable actors , and their movement is based on "Move" behavior .

What i want to happen :
if actor 1 moves toward actor 2 and collide with it , i want actor 1 to "stop" upon collision, or in other words , i don't want it to be able to push actor 2 , simply rest next to him.

What currently happening :
actor 1 moves toward actor 2 , collides with him , and move him (push him) .

all physics attributes (friction, restitution etc) are sets to 0 on both actors .

Now normally , to achieve this i would simply put in actor 2 density to 1000000 , but then if actor 2 is the one that moves toward actor 1 , it pushes him because he has 1000000 density , so again no good for me ,
so i put on actor 1 density 1000000 as well , but guess what , if both actors has the same density values , they act as if they both have 0 !

Next i tried to make a rule saying if collide so change "max speed" to 0 , this helped a little cause it slows down the "push" but the actors are still pushing !

Any help would be greatly appreciated !

Roy.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    What about making a boolean then wrapping the move inside that so for eg...if game.move is false...

    When it collides change it to true so it wont move.

    Darren.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Made a quick video ...not sure if its exactly what your after but might point you in the right direction.



    Darren.
Sign In or Register to comment.