Game Development Community

Is there a function...

by Bruce Morick · in Torque 2D Beginner · 09/15/2015 (6:16 pm) · 3 replies

to accomplish this...

SpriteB rotates SpriteA at a set distance when SpriteA is rotated.
SpriteA will also be moving through space.
Both SpriteA and SpriteB have their own collision shapes.

Like a planet with a moon passing through space and each reacting differently to collisions with asteroids.

#1
09/15/2015 (9:52 pm)
Not built in, no.

You can attach objects to each other using joints - but remember that each object has mass, so your orbiting will cause the satellite to drag the parent around a bit unless there is a great difference between the two masses (just like the real thing).
#2
09/15/2015 (10:59 pm)
Thanks.. I could not find one so I thought I would ask.
#3
09/16/2015 (5:45 am)
See the Box2D documentation for an explanation of exactly how it's supposed to work, and the T2D doc on physics covers the requisite script methods.