Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there any way to make a tool orbit a player?

So what I want to do is making a tool orbit my player in kind of like a infinite sign shape. So I want it to orbit my player in a circle, never breaking it's distance nor it's speed. And then while it's orbiting me going in an infinite sign shape. Once the full orbit circle has been finished the whole infinite sign shape should be finished aswell. And then it'll just loop, I've tried a bunch of stuff but it doesn't seem to work for me. If this is any help, the tool name is BoomBox. Also if it's IMPOSSIBLE to make it go in a infinite sign shape then just make it go around me in random directions.

Thank you for your help.

1 answer

I'm not really sure what you mean by going in an infinity, but also going in a circle.

The parametric equations for a circle are

for r = 0, math.pi * 2, math.pi / 32 do
    x = math.cos(r)
    y = math.sin(r)
end

The parametric equations for an infinity are

for r = 0, math.pi * 2, math.pi / 32 do
    inner = 1 + math.cos(2 * r)
    x = inner * math.cos(r)
    y = inner * math.sin(r)
end

Setting some sort of position vector off these values should do what you want?

NB - "parametric equations" are just another way of representing lines on a graph.

You've probably run into a cartesian coordinate system before - something like y = 4x + 5.

Parametric equations are similar, but rather than representing a single line with a single equation, they break it down into one equation for each of its two coordinates x and y, with a variable t to represent "how far along" each line is.

This discussion is preserved as it was. New answers, comments, and votes are closed.