HELP - Orbiting Problem for T-Shirtbooth / FMG / and other Math Freaks

JCFordJCFord Member Posts: 785
edited November -1 in Working with GS (Mac)
Hello fellow GS Users

I have an Orbiting Problem that I can't resolve, I will do my best to explain the issue!

I have a central actor called "BOX" and I have another actor called "CIRCLE" which is rotating 100 pixels offset around this "BOX" using the following.

CONSTRAIN "CIRCLE" ATRIBUTE
self.Position.X to self.100 *cos( self.Time *-30%360)+ game.BoxX
self.Position.Y to self.100 *cos( self.Time *-30%360)+ game.BoxY

This all works fine, but I wanted to make it so that I can drag the "CIRCLE" actor anywhere on the screen and when dropped it will still rotate around the "BOX" actor in its new offset position.

So along with a Drag attribute I have used the good old Magnitude as follows:
self.MyPosition to magnitude(abs( self.Position.X - game.BoxX ),abs( self.Position.Y - game.BoxY ))

I then revised my original Attribute from the 100 pixel offset to self.MyPosition
CONSTRAIN "CIRCLE" ATRIBUTE
self.Position.X to self.MyPosition *cos( self.Time *-30%360)+ game.SunY
self.Position.Y to self.MyPosition *cos( self.Time *-30%360)+ game.SunY

Now this all works the CIRCLE rotates around the BOX and I can pick up the CIRCLE and drop it anywhere on the screen and it will offset the correct amount so it is no longer at 100 pixels offset, i.e. if I move it 200 pixels away it will drop off 200 pixels away yippppeeeeeee.

BUT the problem is the CIRCLE seems to want to jump to where it was on its original 360 degree path around the BOX, but I want it to continue from where I dropped it off. i.e. IF I pick it up 100 pixels on the left of the BOX and quickly move it 300 pixels to the right of the BOX it, will stay at 300 pixels away from the BOX, but it jumps around to where it would be (360 degrees) if it had continuted on the original path!

I just can't get my head round this one, maybe need some sleep. off to bed.

Comments

Sign In or Register to comment.