Hello ,
I was wondering if there is a way to make the camera focus on area where there the highest count of sprites ( playing with simulated water ) ,i don't want to the camera to follow every lost drop of water .
Thanks
Develop games in your browser. Powerful, performant & highly capable.
You would average the xy's and scroll to that.
Or just use the Scrollto behavior if that's too complicated to figure out.
newt I believe op's question was more about how to detect the area with the largest number of instances.
— Here is my attempt:
dropbox.com/s/hnhxmtscttgu461/ScrollToBiggestGroup.c3p
If you have exact areas where you know your sprites will be gathering (like those pits in my demo), this can be done much easier. You can put invisible blocks there and simply count the number of sprites overlapping the block, and move the camera to the center of the block with most overlapping sprites.
Yeah that's exactly what i need , thank you so much!
Using the scroll to was kinda messy and shaky