I'm trying to make a part teleport to a position using Vectors and its not working. Any help?
Script:
local SavePosOfPart1 = script.Parent.Teleporter.RealPosition1.Position print(SavePosOfPart1) script.Parent.Teleporter.Tele1.Position = Vector3.new(0,0,0)..SavePosOfPart1
You cannot concatenate a Vector3 value, but you can say:
Vector3.new(SavePosOfPart1)
Vector3.new can take in a 3D object value's position too, which can be a part or even an attachment. Since a position property of the object has three numbers, x, y, z.
The reason why it says "attempt to concatenate a userdata value" is because it is under Roblox's custom made classes. Everything in the roblox game engine that is interactive is a class itself. These classes take in "userdata" values which can mean anything made by Roblox.
Here's your script fixed, if it doesn't work reveal some more code and tell me the error if it happens:
local SavePosOfPart1 = script.Parent.Teleporter.RealPosition1.Position print(SavePosOfPart1) script.Parent.Teleporter.Tele1.Position = Vector3.new(SavePosOfPart1)
I can't find too much about Vector3 on the wiki for some reason but here's an article that might help you out:
https://developer.roblox.com/en-us/api-reference/datatype/Vector3