Rotating towards object on different layer

Hi all,

I am trying to make an arrow which is on my GUI layer point towards and object on the base layer.

I don’t seem to be having any luck i am using the rotate towards action but that isn’t working

Points toward object but question is points from where?

Because if its just indication like selected item
Then you could use copy camera settings extension to copy settings from base layer to gui layer

1 Like

Is there any scrolling of the base layer?

If not, does the arrow point 90 degrees out from where it should point? In which case, make sure the arrow image (the actual png/jpg…) is pointing to the right .

1 Like

Maybe I’m not aware of an expression to get an object’s screen location but the only way I could do it was to subtract the camera positions from the object positions. Think of the camera as an offset. If you remove the offset then each object is in the same relative position.

I tested it by putting NewSprite1 on Layer1 and NewSprite2 on Layer2. I then added the drag behavior to both objects and buttons to change the camera locations.

This made each object point towards the other object.

Since the gui layer is probably stationary then you wouldn’t need to subtract it’s camera locations because they would always be zero.