#Me no understand CFrame

15 messages · Page 1 of 1 (latest)

fleet burrow
#
-- example code
local Player = game:GetService('Players').LocalPlayer

local Character = Player.Character
local Debounce = os.clock()
local Tool = script.Parent

local function Activate()
    if os.clock() > Debounce + 1 then Debounce = os.clock()
        local Part = script.Parent.Handle:Clone()
        
        Part.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -5)
        -- CFrame is the origin position of an instance
        -- we referenced the parts origin position to be inside our humanoidrootparts origin
        -- the part will then appear inside our torso
        -- lets say we want it to move it 5 studs in front of the humanoidrootpart
        -- we times * the current parts cframe position, with a new cframe.new() position
        -- it will now be in front of the player by 5 studs

        -- thats pretty much cframe
        
        Part.Parent = workspace
    end
end

Tool.Activated:Connect(Activate)```
plucky sandBOT
#

studio** You are now Level 1! **studio

wicked gust
#

Where did he ask you to add a denounce lol

fleet burrow
#

can u let me finish

wicked gust
#

Lol be my guest

#

@tulip sand just know that the front of any object is the object's CFrame multiplied by a CFrame (or vector) with a negative Z coordinate

compact agate
#

Its a dev forum script

#

Not his

fleet burrow
tulip sand
tulip sand
#

?

plucky sandBOT
#

studio** You are now Level 2! **studio

fleet burrow
#

whats ur end goal

#

why are we using a deprecated method to connect functions to an event