#How do I make the plane translate properly to the white part and rotated around?

1 messages · Page 1 of 1 (latest)

tulip raft
#
local _center = Vector3.new(0, 10, 0)

local _faces = {}
local _points, _distance = 5, 2

_createFace = function(_pos, _rot)
    local p = Instance.new('Part')
    p.Size = Vector3.one * 2
    p.Position = _pos
    p.Anchored = true
    p.Shape = 'Ball'
    p.BrickColor = BrickColor.White()
    p.Parent = workspace

    for _xpoint = 0, _points do
        for _zpoint = 0, _points do
            local p = Instance.new('Part')
            p.Size = Vector3.one
            p.CFrame = (CFrame.new(_pos + Vector3.new((_points/2) * _distance, -(_points*2) * _distance, (_points/2) * _distance)) * _rot):ToObjectSpace(
                CFrame.new(
                    Vector3.new(
                        _xpoint * _distance, 
                        0, 
                        _zpoint * _distance
                    ) 
                )
            )
            p.Anchored = true
            p.Shape = 'Ball'
            p.BrickColor = BrickColor.Red()
            p.Parent = workspace
        end
    end
end

_createFace(_center + Vector3.new(0, (_points/2) * _distance, 0), CFrame.Angles(0, 0, 0))
_createFace(_center - Vector3.new(0, (_points/2) * _distance, 0), CFrame.Angles(0, 0, 0))

_createFace(_center - Vector3.new((_points/2) * _distance, 0, 0), CFrame.Angles(math.rad(90), 0, 0))
hearty temple
#

Wdym