Yes, I do. I would use:
Char:SetPrimaryPartCFrame()
EDIT: I’d say it’s one of the less used ways of teleporting, but it’s quite simple and doesn’t glitch much.
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
plr.Character:SetPrimaryPartCFrame() -- Put where you want to teleport to in the parentheses.
end)
local _, ModY, __ = Character:GetModelSize() -- Gets the size of the player's character model
Character:SetPrimaryPartCFrame(NewCFrame + Vector3.new(0, ModY / 2, 0)) -- Set the new CFrame with an offset of half the player's character model size on the Y axis
Probably not the best solution, but it should prevent a player clipping into a part.
Hey so I did the SetPrimaryPartCFrame method on the player and it works!
However, the glitch also happens when I do the :MoveTo with a model, so I made a primary part for it and used the setprimarypartcframe for it and it fixes the glitch, however, it doesn’t set it in the right position, or say its underneath where its supposed to be.
Is there a method to setprimarypartcframe that’ll make the model always be on top of the grill perfectly? (The black part)
You could try setting up a part akin to a SpawnLocation, and use the code I’d written with one change.
local _, ModY, __ = Character:GetModelSize()
Character:SetPrimaryPartCFrame(NewCFrame + Vector3.new(0, (ModY / 2) + (Part.Size.Y / 2), 0)) -- Add half the part's size on the Y axis as well
Hope I helped. Sorry if I’m not fully matching the criteria as to what you’re asking, I’m a bit confused, could you furthermore elaborate if so? Thanks!
Player.CharacterAdded:Connect(function(Character)
Character:WaitForChild("HumanoidRootPart")
local _, ModY, __ = Character:GetModelSize()
local CFrameVar = workspace.GrillAsset.grillname.station.MainPart.CfFrame
grillfood:SetPrimaryPartCFrame(CFrameVar + Vector3.new(0, (ModY / 2) + (Part.Size.Y / 2), 0)) -- Add half the part's size on the Y axis as well
end)