In the PG below, the grey spheres will follow the textured spheres when within range.
Here’s the issue I’m having trouble resolving:
The grey spheres should always move forward along their z-axis (their “eyes,” blue axis). When they “see” a textured sphere, they should rotate to face the textured sphere as they move toward it. In other words, the “eyes” should always be facing the center of the closest textured sphere.
I tried the code the below, but my main project has about 400 objects moving around, and the frame rate was cut in half (about 30 FPS). Also, the grey spheres don’t always face the textured spheres correctly.
var spherePosition = sphere.getPositionExpressedInLocalSpace(); sphere2.lookAt(spherePosition);
I’m not sure if there is a way to achieve this effect without seriously impacting scene performance.
Any suggestions would be greatly appreciated!