Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would the CFrames be able to get me to a fixed position?

Asked by 3 years ago

How would I get this script to teleport me to a specific position? player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)

So I recently got into cframes and I don't know how this works, whether it teleports me up or down or whatever.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Without knowing where exactly you need the character moved to, I can't really tell you anything other than that your CFrame operation is fine. However, to move the character with CFrames, you should use :SetPrimaryPartCFrame() on the character model. For example:

local Players = game:GetService("Players")
local target = workspace.Target

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:SetPrimaryPartCFrame(target.CFrame * CFrame.new(0, 3, 0))
    end)
end)
Ad

Answer this question