Hello. I am working on TopDown template and I am solving a problem where I would like to use the mouse to change the speed of movement depending on the distance of the cursor and the character. The farther the cursor moves away from the character, the faster the character runs. I tried using the “trigger” using collision sphere and MouseBeginOver but there was a problem with the setup collision. Either the object did not pass through the wall or did not respond to mouseBeginOver.
Then I tried different ways to calculate the distance between cursor and character but it never worked properly. There was always a problem on one side of the axis where it had to be cursor further than on the other side.
I am try something like that
but didnt work perfectly especialy i have problem in diagonals.