# Global point problems

**URL:** <https://forum.kirupa.com/t/global-point-problems/264445>\
**Category:** Uncategorized\
**Created:** [June 26, 2008, 7:01am UTC](https://forum.kirupa.com/t/global-point-problems/264445 "2008-06-26T07:01:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DesignerMichael](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DesignerMichael](https://forum.kirupa.com/u/DesignerMichael)\
**Post date:** [June 26, 2008, 7:01am UTC](https://forum.kirupa.com/t/global-point-problems/264445/1 "2008-06-26T07:01:32Z")

</div>

I can’t seem to get global points to work right in AS3. What am I doing wrong here?

As my targetBuggy rotates within the Stage\>gameLevel… I need the exact locations of the wheels for a hitTest. The hitPointTest never moves up or down, and it should be tracking the wheels, even as the entire targetBuggy child rotates.

```auto
var pointLeftTest:Point = new Point(targetBuggy.x + targetBuggy.Wheel1.x,targetBuggy.y + targetBuggy.Wheel1.y + 8);
            gameLevel.localToGlobal(pointLeftTest);
            var hitPointTest:Boolean = levelHittest(pointLeftTest.x, pointLeftTest.y);

```

---

<div class="post-metadata">

**Author:** ![Insane\_au](https://avatars.discourse-cdn.com/v4/letter/i/439d5e/32.png) [@Insane\_au](https://forum.kirupa.com/u/Insane_au)\
**Post date:** [June 26, 2008, 7:48am UTC](https://forum.kirupa.com/t/global-point-problems/264445/2 "2008-06-26T07:48:50Z")

</div>

The localToGlobal () method coverts the relative coordinates to the global coordinates.  
Also the x and y properties of the wheel shouldn’t change if you rotate the parent object.  
You will likely have to use Trigonometry to work out where the wheel is.

e.g.,  
wheelX = targetBuggy.localToGlobal(Math.sin(targetBuggy.rotation/180\*Math.PI)_targetBuggy.wheel1.y);  
wheelY = targetBuggy.localToGlobal(-Math.cos(targetBuggy.rotation/180_Math.PI)\*targetBuggy.wheel1.x);

not 100% sure if that will work, but something along those lines.
