0 Favourites

How do I make an object move circular?

  • Hello people, I have an object and I want to make it move on border of a circle. To make it clear assume that you have 2 points on a circle which are named A and B. Let's put our object on point A. I want to move that object on the border of the circle but It will go to B and will come back to A. When user clicks on it, it will stop and new frame will be opened. Cheers!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Do you know the radius of the circle?

  • Here's what you do for simple solution. Use pin behavior to an INVISIBLE circle and pin on the VISIBLE circle and give rotate behavior too. Give it an image point (1) for your point A. You could also create a small invisible object and pin it to image point(1) and have it represent point A.

    When Sprite reaches point A, Pin it, activate rotation.

    Also, create an invisible object to represent point B.

    When Sprite is "on collision" or "on overlap" with point B. Kill rotate and un-pin sprite and add any other event you need.

    Much easier than radius calculations.

    Voila !

  • Here's what you do for simple solution. Use pin behavior to an INVISIBLE circle and pin on the VISIBLE circle and give rotate behavior too. Give it an image point (1) for your point A. You could also create a small invisible object and pin it to image point(1) and have it represent point A.

    When Sprite reaches point A, Pin it, activate rotation.

    Also, create an invisible object to represent point B.

    When Sprite is "on collision" or "on overlap" with point B. Kill rotate and un-pin sprite and add any other event you need.

    Much easier than radius calculations.

    Voila !

    Thank you for answer, I'll go for it. Is that possible to do that with "Sine" behaviour?

  • I never thought of that although I would use rotate behavior.

    There's 3rd party rotate behavior from REX plugins here :

    https://dl.dropboxusercontent.com/u/5779181/C2Repo/index.html

    I'm pretty sure it gives you better control, but don't quote me. I have it, but never used it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)