Actor pushes/moves another actor
Tbone
Member Posts: 49
Hello,
Im attempting to have one actor (hero) push another actor (rock).
How can I have the hero push the rock in relation to his direction? ie if Hero pushes from the top, the rock moves down or if the hero pushes from the left the rock moves right?
I set up a game attribute that tracks the hero linear velocity (both X and Y) and made a rule that checks this and applies an opposite position to the rock.
This works fine on the X but on the Y I get a diagonal movement instead of straight up or down.
Does this make sense? Can anyone shed any light on how I could achieve this?
Im attempting to have one actor (hero) push another actor (rock).
How can I have the hero push the rock in relation to his direction? ie if Hero pushes from the top, the rock moves down or if the hero pushes from the left the rock moves right?
I set up a game attribute that tracks the hero linear velocity (both X and Y) and made a rule that checks this and applies an opposite position to the rock.
This works fine on the X but on the Y I get a diagonal movement instead of straight up or down.
Does this make sense? Can anyone shed any light on how I could achieve this?
Comments
To find your rocks position on the Y axis, click on the actor, and check "position" Y, constrain it to that, and see if that helps