playMaker

Author Topic: Controlling blocks around a circle (2D) [SOLVED]  (Read 1022 times)

miilktea

  • Playmaker Newbie
  • *
  • Posts: 4
Controlling blocks around a circle (2D) [SOLVED]
« on: July 22, 2018, 04:48:00 AM »
Hi all,

I'm trying to create a 2d game where the player controls two blocks on their x-axis which rotate around a circle collider simultaneously. Basically, I want them to move around a circular path.

I'm not quite sure how to go about with this? I've tried the set gravity 2d action on the circle, which seems to work and allows the blocks to rotate around, if I try to move the blocks using add force, they fall off. I'm not sure how to get it so that the blocks stay on the surface of the circle. Any help would be appreciated.

Thanks!
« Last Edit: July 25, 2018, 07:45:43 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Controlling blocks around a circle (2D)
« Reply #1 on: July 22, 2018, 02:48:53 PM »
Hi.
Maybe make a (empty) parent and place it in the center from the circle, then set the block as a child to that 'Parent' object.

The use some rotation or torque actions (depends on your game) to rotate them around .

miilktea

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Controlling blocks around a circle (2D)
« Reply #2 on: July 25, 2018, 03:14:33 AM »
Ah, the add torque option did it. Thanks!