Pathfinding on a UI

Hi! I want to tween the green dot in the ui shown below to the red dot but without touching the obstacles in the middle. Do you even need to use Tweenservice for this or is there a way with PathFinding? Does PathFinding even work on UI’s?
(Sorry for the bad English :>)

1 Like

Pathfinding doesnt work for UI. You can make your own pathfinding, and you will have to make your own way of detecting the obstacles position.

One way of doing it is having all the obstacle UIs under one frame, get children of that frame, go through every child and save their position and sizes in your code as areas that your pathfinding should avoid. And then using tweening make your object move avoiding the obstacles, the script of which i wont write because it is way complicated.

As an advice, instead of ui use normal humanoids and change their meshes and camera position to make a 2D effect. With UI you will run into tons of issues like this, and it is absolutely not worth it.

1 Like

I would recommend to create a custom A* solution for that