Collision outside area
AngryBoi
Member Posts: 586
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
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.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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.
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????
Yes now I do, I'll try later. Thanks
@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 -.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
There ! Okay thanks for clearing it up. Thanks @Armelline @tatiang @gattoman
.. The start of a #1 game
@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.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
okay
@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...
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.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks for the help