Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to cast instance to vector3?

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

✓ Accepted answer
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.

2 comments

0

Oml, im so stupid. completely forgot about that. thanks

0

Oh, PSSSSHT

This discussion is preserved as it was. New answers, comments, and votes are closed.