Circular Path Offset Trick !

SocksSocks London, UK.Member Posts: 12,822
edited July 2014 in Working with GS (Mac)

A long and dreary post about a neat little trick ! :)

This is going to be obvious to some of you, and there might even be some out there who already use this, but it only occurred to me today . . . . . here's a quick and easy (and interactive) way to offset an actor travelling in a circular path.

We all know the usual way to send an actor around a circular path (or into 'orbit' around an object), which usually looks like some version of this . . .


Constrain X position to radius * cos (angle) + X centre point

Constrain Y position to radius * sin (angle) + Y centre point


. . . . and as most people seem to use either game.time or self.time for the angle - and as they both (usually) start at zero - then the actor will always start its journey around the circular path at 0° - which is the 3 o'clock position . . . . but if you want the actor to start at, for example, 180° or 90° or 35° ( . . . etc) then you would usually stick the offset in here . . .


Constrain X position to radius * cos (angle +offset) + X centre point

Constrain Y position to radius * sin (angle + offset) + Y centre point


. . . but if you just stick in 'self.rotation' instead of the offset value then you can interactively point the actor to the place you want it to start in the circular path - by 'interactively' I mean you can do this while in scene layout mode, just drag the actor's rotation handle to the desired start position.


Constrain X position to radius * cos (angle +self.rotation) + X centre point

Constrain Y position to radius * sin (angle + self.rotation) + Y centre point


https://www.youtube.com/watch?feature=player_detailpage&v=SW4NvStDpYM

Obviously this method will be useless for actors that need to be a certain fixed rotation, but for a lot of day to day game stuff (moving dots, asteroids, moons, spinning diamonds of death, visual FX . . . . etc) it might be handy.

Comments

Sign In or Register to comment.