Arrays of entities

Blitz3D Forums/Blitz3D Beginners Area/Arrays of entities

That's because your entity variable is local to the function and lost once the function ends.

You need a return value from the function (or don't use the function at all).
Dim actors(10)
For n=0 to 9
 actors(n) = test_func()
Next

camera=createcamera()
pointentity camera,actors(0)

Function test_func()
  entity=CreateSphere(8)
  PositionEntity entity,Rnd(-3,3),Rnd(-3,3),Rnd(-3,3)
  Return entity
End


Edit: looks like Noel beat me to it.