MoveTo (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens When you put examples, describe them... |
m Text replacement - "</code>" to "</SyntaxHighlight>" Tags: mobile web edit mobile edit |
||
Line 8: | Line 8: | ||
This will move the player named 'Player' to 100 studs above the center of the map (assuming the map is centered around 0, 0, 0): | This will move the player named 'Player' to 100 studs above the center of the map (assuming the map is centered around 0, 0, 0): | ||
<code lua>Workspace.Player:MoveTo(Vector3.new(0, 100, 0))</ | <code lua>Workspace.Player:MoveTo(Vector3.new(0, 100, 0))</SyntaxHighlight>}} | ||
There is also a separate ''MoveTo'' method exclusively for the [[Humanoid]] object. | There is also a separate ''MoveTo'' method exclusively for the [[Humanoid]] object. | ||
Line 25: | Line 25: | ||
This will make the player named 'Player' move to the part named 'Part', located in the Workspace: | This will make the player named 'Player' move to the part named 'Part', located in the Workspace: | ||
<code lua>Workspace.Player.Humanoid:MoveTo(Workspace.Part.Position, Workspace.Part)</ | <code lua>Workspace.Player.Humanoid:MoveTo(Workspace.Part.Position, Workspace.Part)</SyntaxHighlight>}} | ||
[[Category:Methods]] | [[Category:Methods]] |
Revision as of 03:22, 27 April 2023
![]() | |
Returns | nil |
Description: | Moves the object and all children instantly to the destination. |
Member of: | Model |
Example
This will move the player named 'Player' to 100 studs above the center of the map (assuming the map is centered around 0, 0, 0):
Workspace.Player:MoveTo(Vector3.new(0, 100, 0))</SyntaxHighlight>
There is also a separate MoveTo method exclusively for the Humanoid object.
Example
This will make the player named 'Player' move to the part named 'Part', located in the Workspace:
Workspace.Player.Humanoid:MoveTo(Workspace.Part.Position, Workspace.Part)</SyntaxHighlight>