r/code • • Jan 05 '21

What does this mean I can’t figure it out(First picture problem second my code) it is written in c#

13 Upvotes

9 comments sorted by

2

u/[deleted] Jan 05 '21

Change public float velocity - 1; to Public float velocity = 1; that's the most glaring error I noticed. Besides that, your code looks alright

1

u/Ethan-J-T Jan 05 '21

I did didn’t work

2

u/[deleted] Jan 05 '21

Maybe it's a different file then, the debug console showed a 27 but that code only had 26 lines

1

u/[deleted] Jan 05 '21

It says you’re missing a comma somewhere, clicking the error message should allow you the jump to the line or something depending on your IDE

1

u/Ethan-J-T Jan 05 '21

I’m doing this on unity

1

u/Jackplox Jan 05 '21

double click the error in unity and it should show the line where the error is

3

u/WasserTyp69 Jan 06 '21

Line 8

public float velocity - 1;

What is that supposed to mean? Should this be an assignment, like

public float velocity = -1;

or do you want to take the current velocity (which is not defined in this scope) and decrease it?

1

u/Jackplox Jan 05 '21

double click the error and it will highlight the line which the syntax error is in. it seems you're missing a comma

0

u/yeahlolnice Jan 06 '21

Should line 9 be ‘private Rigidbody2D = rb;’