It is not possible to invoke an expression of type 'UnityEngine.Vector3'.

Mah homies, I really really don’t get it why this is happening… My game is 2D and I made all I know, but this is happening. Please, someone halp me, I’m newbie. . . I’m very, very noob.

Here’s mah JS

#pragma strict
var speed : float;
function Start () {
    speed = 3;

}

function Update () {

    if(Input.GetKey(KeyCode.A)){

        transform.position(-Vector2.right*speed*Time.deltaTime,0,0);

    }

    if(Input.GetKey(KeyCode.D)){

        transform.position(Vector2.right*speed*Time.deltaTime,0,0);

    }
}

All I wanna do is make my sprite walk forward and backward :c

EDIT @NoseKills : code formatted

So you want to change the sprite according to the direction the player is moving correct? So what you would do is something like this >

`#pragma strict
var LeftSprite : Sprite;
var RightSprite : Sprite;
var speed : float;
function Start () {
%|-181402834_1|%

}

function Update () {

%|-1034111654_2|%

     SpriteRenderer.sprite = LeftSprite;

%|-425750027_4|%

%|1106174785_5|%

 if(Input.GetKey(KeyCode.D)){

%|-819087453_7|%
transform.position(Vector2.rightspeedTime.deltaTime,0,0);

 }

}` all you have to do is set the variable leftsprite and rightsprite in the scripts inspector using unity, then it should switch accordingly