Collision outside area

Okay, so I am looking for a way to when I go outside a circular area, my actor destroys. I have tried not colliding with a circle object, but at the start of the scene, the actor destroys. Is there a function I could use so when the actors position is greater than a certain number, the actor destroys?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Yes, use the magnitude() function. It measures the distance between two points. So if you use the center of the circle as one point and the position of the actor (its center) as the other point, the magnitude will tell you the distance between them.

  • AngryBoiAngryBoi Member Posts: 586

    Thanks, but I don't need to know the distance, I need my actor to destroy pence it hits the end outside of the circle.

  • GnarlyGnarly canadaMember Posts: 840

    taitang is correct though.

    If you know the distance between the centre of circle to the centre of your actor. If this distance is greater than the radius of your circle your actor must be outside of the circle..... Make sense????

  • AngryBoiAngryBoi Member Posts: 586

    Yes now I do, I'll try later. Thanks

  • ArmellineArmelline Member, PRO Posts: 5,415
    edited June 2015

    @tatiang is telling you how to do it.

    If you want to trigger the action when the moving actor is entirely outside of the circle, rather than at all outside of the circle, change the + here to a -.

  • AngryBoiAngryBoi Member Posts: 586

    There ! Okay thanks for clearing it up. Thanks @Armelline @tatiang @gattoman

  • AngryBoiAngryBoi Member Posts: 586

    .. The start of a #1 game

  • AngryBoiAngryBoi Member Posts: 586

    @Armelline Why does the circle move at the beginning of the layout? Can I keep my circle where I want it?

  • ArmellineArmelline Member, PRO Posts: 5,415
    edited June 2015

    @LamboDriva said:
    Armelline Why does the circle move at the beginning of the layout? Can I keep my circle where I want it?

    There are two change attributes to centre it. Just remove them. You'll also need to change the magnitude function to reflect the new position.

  • AngryBoiAngryBoi Member Posts: 586

    okay

  • AngryBoiAngryBoi Member Posts: 586

    @armelline My circle area is in the center of the layout and is 568 by 568. I cant figure out how to do so with this...

  • ArmellineArmelline Member, PRO Posts: 5,415

    Replace screen.width/2 and screen.height/2 with the x and y co-ordinates your circle is placed in.

    Where is says > 250 change that to 1/2 of your circle's width.

  • AngryBoiAngryBoi Member Posts: 586

    Thanks for the help

Sign In or Register to comment.