Yes, I tested it in debug mode, and the arrays receive the individual number of the terra object. The player moves to the object's location, but when they arrive, it doesn't switch the object's frame as it should. Also, if I click on another terra object while the player is on their way to the first one, the action for the first object gets canceled, and the player moves toward the last clicked object instead.
My code seems identical to yours now. I fixed the issue where the click detection was set to respond only to left mouse clicks, and I reviewed the entire code. It looks correct, but I believe there might be a conflict caused by using both codes for moving the character with pathfinder behavior. I can't get it to work properly.
I'm attaching a link for a youtube video showing how the system works in another game, which demonstrates the functionality I’m aiming for. Thank you for helping me!
youtube.com/watch