# How do I rotate an object clockwize around a point?

From the Asset Store
Connect the dots in the correct order and draw happy animals!
• Might sound simple but I couldn't find a definite solution in the forum.

I have a objects that should rotate clockwise around another sprite. The distance to this sprite can vary, but the rotation speed has to be constant. For example the far one would take longer to rotate around the object the closer one would orbit faster, but they would have the same "speed". Pixels per second.

Any idea how I would go about that?

• I can get the speed with this formula. angle = 20 / ((2*Pi*R)/360) but the distance to the pivot can change.

So how do I rotate something clockwise around that moving point?

• If it's moving clockwise then set its angle to angle(self.x,self.y,other.x,other.y)

• Might sound simple but I couldn't find a definite solution in the forum.

I have a objects that should rotate clockwise around another sprite. The distance to this sprite can vary, but the rotation speed has to be constant. For example the far one would take longer to rotate around the object the closer one would orbit faster, but they would have the same "speed". Pixels per second.

Any idea how I would go about that?

Im not 100% sure what you mean the "far one would take longer to rotate" If they have the same speed they both rotate at the same speed, but see if this can help:

https://www.dropbox.com/s/spe0gttivvzwhpj/OrbitPlanets.capx?dl=0

• I believe he wanted a constant linear speed. Here's my take on it, using your formula.

https://www.dropbox.com/s/59lavr8k6xsb2 ... .capx?dl=0

• ## Try Construct 3

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

Construct 3 users don't see these ads
• I believe he wanted a constant linear speed. Here's my take on it, using your formula.

https://www.dropbox.com/s/59lavr8k6xsb2 ... .capx?dl=0

Hou, I see now!, nice one man

• Just so happens I'm creating game that uses that mechanic.

Check out my template:

https://www.dropbox.com/s/gqqa39cq2ds7k ... .capx?dl=0

• I believe he wanted a constant linear speed. Here's my take on it, using your formula.

https://www.dropbox.com/s/59lavr8k6xsb2 ... .capx?dl=0

Close but no cigar. But I think I have something to work with. Thanks.

What I'm trying to do is more of a movement system.

1 The red box should always face the Mouse pointer. This is where it is looking.

2 pressing arrow up or down should move the box closer or further from the mouse pointer.

3. Pressing left or right should orbit the red box around the mouse pointer, clockwise or anti-clockwise. Based on the distance to the mouse pointer (this distance is relative)

I think I have what I need from your example to solve the last few bits. Thanks.

• Just so happens I'm creating game that uses that mechanic.

Check out my template:

https://www.dropbox.com/s/gqqa39cq2ds7k ... .capx?dl=0

Yes something like that exactly. I just need to make the distance variable based on distance to mouse pointer.

• Yes something like that exactly. I just need to make the distance variable based on distance to mouse pointer.