Can someone give me a little summarization of how you can use getHitObjectList() (or even scene.getObjectList) and in range() to, say, get the distance from the player to all other objects in the scene? I would just like the basic syntax of a statement like this please…
If you’re looking for a way to get the closest object, you don’t need to do distance calculations:
http://socialstorage.googlepages.com/AI_Coin.blend
It works on a “sonar” principle. Basically, you have an octagon mesh with a size expansion IPO. So as the octagon expands in all directions, it hits the closest objects first, and then you can get that hit obect from the collision sensor set on the expansion mesh.
thats pretty ingenious, but i was just giving an example. What if you wanted to run a loop that iterated over every object in the scene and retreived a value of some property? How would you do that using said functions?
Yes, yes it is.
but i was just giving an example.
What example? All I read was you asking a question, I didn’t see any “examples”.
What if you wanted to run a loop that iterated over every object in the scene and retreived a value of some property? How would you do that using said functions?
Please, no hypotheticals, just tell me exactly what you are trying to do in your game.
I mean I don’t know what “loop” you are reffering to, and with what values, and what said functions. So just tell me what you’re making.