Wanted to share a current issue im having, hoping for someone to know how to fix it
Lets say we have this coordinate plane.
My game is topdown view. Supossing the character is the red dot, I would like to inverse completely the movement of the player. Example, if I click Coord (X=1, Y=1), I would like the end result to be Coord: (X=-1, Y=-1) so basically the inverse of square 1 is 3… The inverse of 4 is 2 and so on.
By using this I can solve it, but just on the “coordinate plane” meaning this is not passed on to the World Coordinates, which is why I need.
if my player is in coordinate 0,0,0 and I click 100,150,0 I want the final coordinate to be -100,-150,0
Hope it makes sense. Basically inverse the world coordinate, based on the cartesian system.
So I would need to somehow convert my cartesyan coordinate to the world coordinate, which I cant find a way, unless there is an easier way (using trace?)
To make it more simply, the distance from my player to the click, I need that same distance but inverse. The issue is not obtaining the distance, but reversing that (getting the inversed coordinates) since the player will most likely not be on a 0,0 vector
The red lines are the click.
I just added another trace on the end of the inverse to grab the floor coordinates. Just what I needed - spent the whole day trying and researching.