Godot Version
Godot 4.4
Question
Any way to access the most recently selected object? For example I have 2 characters I can switch between by clicking on them. If I click on one, I want to take that object’s value and do something.
And I have the camera attached to a staticbody, I would like to take the static body along with its child camera and have it tween (or tween it) to the selected character’s position.
I managed to get this somewhat working, but, I want to have the camera go to the most recently selected characters position, and then be able to click between characters and have it tween and follow between the two depending on which on I just clicked, along with maybe other conditions to change tween destinationlocation of body. Coming up short on all my solutions.
Was thinking of checking if the mouse position was equal to the character position when clicked, setting a selected variable as true if those are equal, and then do another if statement where I apply the logic to whichever character had the position equal to the mouse…
but there is an offset, so it’s never exactly equal and my brain cannot logically figure how to remove this offset and apparently I don’t understand clear instruction, plus that could be the wrong approach to begin with, so I am stumped.
Any advice is much appreciated! Thank you for reading