I'm creating a simulation in blender whereby the objects move randomly, but where the code I have attached applies.

At the moment, they are stationary.

The code I have attached basically states that when in a given distance within each-other, objects can spawn at their location.

Dnapolymerase is an object which upon reaching a certain radius between nucleotides, can spawn nucleotides at their location. Almost like the snake game? Where snake eat apples and grow longer.

I'm hoping to get the same kind of result in this simulation, without using physics in the game engine or using keyboard sensors. The movement must be completely random.

Random movement was achieved in the previous code I had, most likely by looking at nearest.worldPosition or something like that, but I'm not sure how I can apply that to the code I have.

Any help would be amazing.

(I've attached all relevant code/video and if need be I can send you blend files of my script)

This is probably going too far, but I'm willing to literally pay someone to help me. I'm not kidding. I am prepared to do this.

The code I'm working with for this function

The link shows a video which depicts how I would like the objects to move (tinyurl)

  • 1
    $\begingroup$ What exactly is you question? $\endgroup$
    – Monster
    Feb 15, 2017 at 7:23
  • $\begingroup$ I think the best way to do this is by assigning your main function to a frame change handler. This way your simulation can be executed by starting the animation, and you will also see the result live in the viewport. This is a good example on how to set up a frame handler: blender.stackexchange.com/questions/7904/… $\endgroup$
    – TLousky
    Feb 15, 2017 at 14:47


Browse other questions tagged .