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

Unable to cast instance to vector3?

Asked by 7 years ago

So, I am trying to make a teleporter to a certain block. I feel like this is right, but the error message "Unable to cast Instance to Vector3" keeps appearing. Here is my script.

local Part = script.Parent
local Location = script.Parent.Parent.Reciever
Part.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local Character = hit.Parent
        Character:MoveTo(Location)
    end
end)

1 answer

Log in to vote
1
Answered by 7 years ago
local Location = script.Parent.Parent.Reciever.Position

Well um, I'm pretty sure MoveTo() needs a Vector3 point, so just add .Position to your location variable. I hope this works.

0
Oml, im so stupid. completely forgot about that. thanks IamTewsmrt 6 — 7y
0
Oh, PSSSSHT ReadyHappiness 109 — 7y
Ad

Answer this question