You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to know why my character wont teleport to the specified cframe.
What is the issue? Include screenshots / videos if possible!
I have a line of code to change the player rootpart cframe to a part cframe, in studio it works, but outside of studio, they teleport to a whole new location.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried using position, but the same happens. Ive tried searching for an fix, but I couldn’t find any good ones.
I also dont get any errors, which makes it a ton harder to figure out what is happening.
The script changing the cframe is this:
local character = plr.Character
local part = Workspace.Map.Spawn
character.HumanoidRootPart.CFrame = part.CFrame
Some parts may not be loaded as soon as game begins so you need to use :WaitForChild() instead of .
Try this code:
(or the problem may be the part isn’t anchored as @slatinedd says)
local character = plr.Character or plr:CharacterAdded:Wait()
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
local part = Workspace:WaitForChild("Map"):WaitForChild("Spawn")
HumanoidRootPart.CFrame = part.CFrame
yeah, that makes sense seeming as if its a on-join teleportation type thing. However, why not just use a spawn-block for that type of stuff? It’s much simpler and easier