# Directional Positioning Math Problem

• 14th February 2015, 01:35 PM
Kid_Roleplay
Directional Positioning Math Problem
Say if you want something positioned at a distance away from an object according to its direction, and at an origin different from 0. You'd do:

Object 1:

Set position to 0,-64 of Object 2 (located)

This way, whatever direction Object 2 is facing, Object 1 will be attached 64 pixels above it in accordance to its direction. In this case, it's assumed the direction is 0, or facing right/east. Thus, if Object 2 is facing left/west, then Object 1 will be positioned 64 pixels below it. The position rotates.

What I need to figure out is how to do that with an expression, finding the X and Y coordinates of what this relative position should be, and then moving secondary objects towards it with only arrays (static movement).
• 17th February 2015, 04:42 PM
Decal
I have made an example that might help
Hi

I'm not quite sure what you are asking for but I made an example of how you can position an object a certain distance away from another depending on the objects direction.

See the attachment.