I’m trying to match the frame of reference of two GUI objects with different parents.
I have five Frames; Background, Cannon, Tip, Bullet, and Enemy.
Background, Cannon, Bullet, and Enemy are inside of the ScreenGui that’s inside the StarterGui
Tip is inside Cannon.
Background is a white rectangle that fills the whole screen.
Cannon is a small brown-ish rectangle that’s in the center, which is constantly rotating to point at the mouse.
Enemy is a small red square that’s being cloned to tween at the cannon from random directions and positions.
Tip is a small square that’s matching the color of Background (invisible), and is on the tip of the cannon.
Bullet is a small black square that’s being cloned at the same frame of reference of the Tip to tween at the direction of the mouse.
The issue is, I can’t seem to match the frame of reference.
Bullet should be at the same frame of reference that Tip is in (Positions can be different), but I’m not sure how.
I’ve tried converting the positions for the Bullet to match the Tip’s from inside the Cannon to inside the Screen, but since the Tip’s position is fixed and the Cannon is constantly rotating, the frame of reference of the Tip is always changing relative to the rotation of the Cannon.