Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: heavygunner on March 31, 2020, 12:23:06 PM

Title: Push Object on opposite direction when collide
Post by: heavygunner on March 31, 2020, 12:23:06 PM
Hi !

Let's say one cube is running on ground. When player collided with that Cube, cube should be pushed on opposite direction.
Any idea ?

Thanks
Title: Re: Push Object on opposite direction when collide
Post by: djaydino on March 31, 2020, 01:45:50 PM
Hi.
Maybe something like (for 2D) :

On collision :
Get position x player
get position x cube
float compare if player x less than cube player is on left side (do push right)
if greater then the other direction.