View Single Post
  #4  
Old 06-11-2015, 12:26 PM
MissingAFew MissingAFew is offline
Member
 
Join Date: Apr 2015
Posts: 15
Quote:
Originally Posted by lalechuza View Post
Hey again!

I tried to use the proximity sensors now, but I think it is not the solution I am looking for. (Although I love the sensors and using it for some other things now )
Maybe my description of what I am trying to do was inaccurate.
What I want to implement is a scene for an experiment where the cylinders are already initialized. If I understand correctly the sonsors are checking if a target enters/exits, but thats not happening when initializing. The new cylinder is "just there" at a moment.
Is there still a way to get it working with the sensors?
Well, what I was imagining was that when you create your cylinders in random spots, if a cylinder is too close to another cylinder then the proximity sensor would be aware that its too close and call a function to move that cylinder. This wouldn't be initializing their position before the program starts, it would be resetting their position during runtime until the cylinders are no longer touching/overlapping. Once they are no longer overlapping they will no longer be moved. This could be a very quick process and happen in a fraction of a second, depending on the number of cylinders and the area the cylinders are allowed to be in. Worst case, the space isn't big enough for them all and it continues to move the cylinders around randomly and it never stabilizes.

Your original idea wasn't a bad one though. You could still do it that way. Keep all the cylinders in an array along with their positions and manually loop through them to ensure they are far enough from each other.
Reply With Quote