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

Vector3 Expected but got number, need help on my custom movement! How do I fix it?

Asked by 7 years ago

This is just testing. Everytime I play it says Vector3 Expected got number

self.Update = function(position)
        --Forward
        local Position = Vector3.new(0,0,0)
        self.UpdatePosition = Position;

        if self.forward == true then
            Position = Position + self.Forward * Speed
        else
            return;
        end
        --Backwards

        if self.backward == true then
            Position = Position - self.Forward * Speed
        else
            return;
        end
        --left

        if self.left == true then
            Position = Position + self.Sideways * Speed
        else
            return;
        end
        --Right

        if self.right == true then
            Position = (Position - self.Sideways * Speed)
        else
            return;
        end
    end
0
We don't know what self.Sideways, self.Forward, or Speed is. Also, you aren't actually doing anything with Position. XAXA 1569 — 7y
0
Also, be careful of distiguishing variables by capitalization, such as "forward" vs "Forward". GoldenPhysics 474 — 7y
0
I think u r a totally different language that is not Lua greatneil80 2647 — 7y

Answer this question