#Uncentered Orbit

1 messages · Page 1 of 1 (latest)

alpine patrol
#

I was messing around with cframe to make this orbiting vfx, but i soon realised that its not quite centered

Heres what i did for now (local)

local player = game.Players.LocalPlayer
local OriginPart = game:GetService("ReplicatedStorage").Part
local char = player.CharacterAdded:Wait()



function Ring(Amount:number, Distance:number, Speed:number)
    local System = Instance.new("Model")
    System.Parent = char
    local Angle = 0
    for i=1, Amount do
        local Part = OriginPart:Clone()
        Part.CanCollide = false
        Part.CFrame = char.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(360/(Amount)*i), 0) * CFrame.new(0,0,Distance)
        Part.Parent = System
    end


    local CalculateNewCFrame = coroutine.create(function()
        while true do
            Angle += Speed
            task.wait(0.01)
        end
    end)

    coroutine.resume(CalculateNewCFrame)

    while true do
        System:PivotTo(CFrame.new(char.HumanoidRootPart.CFrame.Position) * CFrame.Angles(0, math.rad(Angle), 0))
        task.wait()
    end
end

--Frame is 0.01, multiply speed by 100 to get the speed of the angle after 1 second
--coroutine.resume(coroutine.create(Ring(5, 10)))
--coroutine.resume(coroutine.create(Ring(3, 15)))
task.spawn(Ring, 5, 10, 0.5)
task.spawn(Ring, 3, 15, 1)

#

i wonder how i can get it to be more centered

tall bane
#

Uh

#

wachu mean by centered

#

like the blocks closer to the player?

alpine patrol
#

the blocks are rotating around the player

#

but its not rotating in a perfect circle

tall bane
#

ohh

alpine patrol
#

as you can see i have 5 inner blocks

#

3 outer blocks

tall bane
#

so u want like rings?

alpine patrol
#

but theyre merging together

#

yes

tall bane
#

I’m not good but I’ll help thinking

#

how many scripts file are there

#

that u made

alpine patrol
#

just this one

tall bane
#

what do u think

alpine patrol
#

i am not sure, maybe because of the way roblox determines the center of a model?

#

i'll see what i can do when i compile them into the model

bright ingot
#

it looks centered for me

tall bane
#

no bro the outer ring

#

it collides

#

huh

#

Is it because

#

just maybe

#

the distances only takes place in (x, y, z(distance)) coordinate

#

oh shoot no

cinder wrenBOT
#

studio** You are now Level 5! **studio

tall bane
#

my bad

#

I was delulu man I’m getting dizzy

alpine patrol
#

ah i found out the reason

#

i needed to set worldpivot first

tall bane
#

whats that

alpine patrol
alpine patrol
sinful rampart
#

i think ur multiplying them in wrong order

alpine patrol
#

so basically roblox calculated the worldpivot by itself which was close enough to the humanoid root part and it made it look close enough

#

when i shoulda set it myself