I am trying to create a script that will move a player to a part. I have a script setup so when they buy the item, it will wait 5 seconds, then move the player to a parts position where their item is located. The part i can’t figure out is moving the player to the part. Heres a example:
script.Parent.MouseButton1Click:Connect(function(Player)
local Char = Player.Character
Char.Position = game.Workspace.TPPart.Position
@polill00 would teleport the player to the part. If you want that make sure to add a positive y vector so they dont clip. If you want it to move to it smoothly you would use the method humanoid:MoveTo(vector) make sure to apply a animation when this happens else it will kinda just slide. And make sure to do this on the server!
Wow! It worked PERFECTLY. All I really will need to do now is add a wait to make it more smooth, but, with what @Diamond_Plus1 said, i am not having any clipping issues, so i should be fine on that part
CFrame , short for coordinate frame , is a data type that describes a 3D position and orientation. It is made up of a positional component and a rotational component. It includes essential arithmetic operations for working with 3D data on Roblox.
One last problem i just noticed; I am moving a vehicle from Rep Storage to Workspace, and whenever i move it, the seats no longer work? Ive tested it without moving it to rep storage, and it works fine
In roblox the CFrame is an instance composed of 3 numbers, which represent the 3 axes of the three-dimensional workspace, namely X, Y and Z. The CFrame is used most of the time to change the position of any material instance that has this three-dimensional property . I hope I have been of help to you!