This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes
extends KinematicBody2D

export(float) var move speed = 200

var velocity : Vector2 

func _physics_process(delta):
         var input = get_player_input()

         velocity = Vector2(
             input.x * move_speed,
         )

I get the error parsing expression, misplaced: ')'

in Engine by (16 points)

2 Answers

0 votes

A Vector2 takes two inputs (x and y) , and you've only given one. What about the y value?

by (22,191 points)

Thank for replying, ur correct I set,

input.x * move speed,
0

I added 0,
Voila it started to work thanks for replying
I was stbling upon hours thanks for reaching out

Thank for replying, ur correct I set,

input.x * move speed,
0

I added 0,
Voila it started to work thanks for replying

0 votes

You're trying to define a Vector2 with only one value. It needs both an x and a y value...

     velocity = Vector2(
         input.x * move_speed, <need_some_y_value_here>
     )
by (22,704 points)

Ur right mate thanks for replying, I was spending hours and hours figuring it out thanks for Even replying mate.

Input.x * move_speed,
0

I set 0 then it started working thank u mate keep up the gd job.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.