system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
Jack123 |
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: ‘)’
system
2
|
|
|
|
Reply From: |
kidscancode |
A Vector2 takes two inputs (x and y) , and you’ve only given one. What about the y value?
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
Jack123 | 2022-09-27 23:29
Thank for replying, ur correct I set,
input.x * move speed,
0
I added 0,
Voila it started to work thanks for replying
Jack123 | 2022-09-27 23:29
system
3
|
|
|
|
Reply From: |
jgodfrey |
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>
)
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.
Jack123 | 2022-09-27 23:35