Is there a way to detect whether I am moving towards a particular entity or if I am moving towards a particular entity type?
The issue I am having is to check whether I have hit a fence. At that point I want to turn around and move in the other direction. However, the collision is still happening so I can never auto move.
So I need to know if I am heading towards the fence or away from it.
I have tried this but unless I loop through all my fences I can't detect.
if (this.distanceTo(EntityRobotFence)< 50) this.stopMoving();
This doesn't work btw.