Constrain Actor Position to Opposite Mouse Position Relative to Other Actor

I have a "Main Char" actor which is controllable by arrow keys and walks around a top-down / bird's eye map. The character shoots where the mouse is clicked. I would like to constrain an actor, "Mob", to the opposite side of the Main Char actor from the mouse. Please see the attached graphic.

http://i.imgur.com/kG0EVy9.jpg

For instance, if the difference between the Main Char position and the mouse position is (150, -100), I would like the difference in position between Main Char and Mob to be (-150, 100).

Thanks. I've been racking my brain for this!

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2015

    Constrain MobX to MainX - ( MouseX - MainX )
    Constrain MobY to MainY - ( MouseY - MainY )

Sign In or Register to comment.