Mid point of a circle and detect outside it

I have an actor (circle) and I want to detect another actor going outside that circle. What's the best way to accomplish this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I used this site to build the attached demo. Might be helpful.
  • SingleSparqSingleSparq Member Posts: 1,339
    I will check this out - thanks @tatiang!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Actually, the easiest method might be to calculate the distance magnitude between the two actors and have a rule that says if [magnitude] > radius --> do something awesome.
  • SingleSparqSingleSparq Member Posts: 1,339
    Yes - Actually easier than I thought. Made a self attribute on the moving actor self.distancefrom and constrained to that magnitude( self.Position.X -624, self.Position.Y -380) - The 624 and 380 being the x/y location of the circle.

    Now a rule which says if self.distancefrom is greater than 360 (half the size of my circle) do something. Seems to work so far.
Sign In or Register to comment.