Spawning around a circle
krousty_bat
Member Posts: 48
Hi
I'm trying to Spawn an actor randomly around a ball actor (so a circle), with of course my spawning circle being bigger (higher Radius or Diameter) than the 1st Ball, so they don't collide or touch or be on top of each other.
can someone help me to find the Mathematic formula I should enter in Spawning X and Y to do this ?
thx a lot
I'm trying to Spawn an actor randomly around a ball actor (so a circle), with of course my spawning circle being bigger (higher Radius or Diameter) than the 1st Ball, so they don't collide or touch or be on top of each other.
can someone help me to find the Mathematic formula I should enter in Spawning X and Y to do this ?
thx a lot
Comments
Create Object Attribute -> Random_X
Create Object Attribute -> Radius
Change attribute: Radius = 50
Change attribute: self.Random_X = Random (-self.Radius,self.Radius)
Spawn Actor
X=self.Random_X
Y=sqrt((self.Radius^2)- self.Random_X ^2)
You can spawn every 0.1 seconds a dot or small actor first to see how it's working
Just have to find a clever way to make it work on full circle now, for this is making it work on a Half circle.
http://gamesalad.com/game/11536
(to learn how to post and learn too .