Hello,

I’ve been working on this for about a day now so hopefully someone can help a bit. I have flat square surface with a picture on in floating in the game work. I’m trying to find the x and y location of the click on this flat surface with the top left location being (0,0).

As of right now I’m doing a trace to the surface from my character and then calling GetActorBounds on the surface that I click on. The problem is that the actorbounds change depending on the actor’s rotation. Based on the pitch roll and yaw I’m getting varying values for my (X,Y) click position.

```
if (actorRotation.Yaw >= 0) {
xpos = (actorBounds.Y - clickPosition.Y) / (actorBounds.Y * 2) * compscale.X;
ypos = (actorBounds.Z + clickPosition.Z) / (actorBounds.Z * 2) * compscale.Y;
}
else {
xpos = (actorBounds.Y + clickPosition.Y) / (actorBounds.Y * 2) * compscale.X;
ypos = (actorBounds.Z + clickPosition.Z) / (actorBounds.Z * 2) * compscale.Y;
}
```

The above code is rudimentary and flawed. It works if Yaw is 90 or -90 but if roll changes or yaw changes the value changes.

What is the formula for getting pixel perfect x,y positions? I’ve already tried every combo of sin and cos that I can think of but doing so just throws it off even more.

Help would be appreciated.