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

(User.Name) has no origin position?

Asked by 1 year ago

Im trying to learn character teleporting and i keep getting an error message "Origin Position is not a valid member of model (User.Name)"

this is the local script inside a button in starterGUI

script.Parent.MouseButton1Click:Connect(function()
    local player = game.Players.LocalPlayer
    local Chara = player.Character or player.CharacterAdded:Wait()

    Chara["Origin Position"] = "15.336, 82.634, 11.484"
end)

1 answer

Log in to vote
1
Answered by 1 year ago

You can't get the Origin Position and Origin Orientation of a model. Instead, edit its pivot's position. Also, when changing a position, use Vector3 and not a string.

Chara:PivotTo((Chara:GetPivot() - Chara:GetPivot().Position) + Vector3.new(15.336, 82.634, 11.484))
0
Thank you, im a beginner script so could you please explain what PivotTo and that stuff, it doesnt have to be a super detailed explanation i just wanna know for later reference Black_Magic2533 104 — 1y
0
PivotTo is basically like SetPrimaryPartCFrame, except that you don’t need to set rhe primary part, and you can edit the pivot. It can be used when teleporting Parts/Models, moving and rotating. T3_MasterGamer 2189 — 1y
0
If this answer really helpful and it solved your problem, please accept my answer so other people can see it too :) T3_MasterGamer 2189 — 1y
0
You can learn more about pivots here: https://developer.roblox.com/en-us/resources/studio/Pivot-Tools T3_MasterGamer 2189 — 1y
Ad

Answer this question