Hi, im currently writing code for a sheep flocking simulator. My sheep game object is stored outside my main collection so i can spawn multiple instances via a factory. However, within my game object sheep i want to be able to access the location of the nearest other sheep using go.get_position(). Whenever i do this it says the instance cant be found. I need to be able to do this to include cohesion in my sim.
Can anyone help - even better if you’ve tried Boids or flocking sim in defold before?
Here is what my files in defold look like. In this case, test.go is my sheep game object of which multiple instaances are spawned via factory within main.collection
could you share some of the code so we can see how your getting the other sheeps position? Error messages or the bug in question happening would be helpfull as well (even better if your able to send the project via github link or .zip here in the forums)