Hello,
Im sorry if this has been asked but ive searched and cant find a thing.
So, I was wondering how to get all objects near a point like the title says.
I would Prefer NOT to use raycasts because my object may have a different Y cord.
Thanks,
I use Unity Script
I think this function solve your problem:
The way I see this is like there is some gravitational pull at some place, i.e. could be some super villain just to paint a nice picture. Now this spell would move all nearby objects towards the origin of the pull. You will need to do a lot of math to get the objects to move towards the center if you want the objects to move based on their current rotation or you can simplify it by having the game objects LookAt
the origin of the pull which causes them to turn around with the Z axis pointing towards the origin, then just add a force to them and they will all move uniformly.
To get some cool stuff happening you would need rigidbody and customize each objects mass, and resistance, but if you just want a simple pull then just make your own move to center function.