Assets\scrips\NewBehaviorScript.cs(7,35)_: error CS1003: Syntax error ',' expected

Always use code-tags when posting code. Never plain-text.

Why not tell us which line it’s on because the error also includes the exact line and column? As it stands, you’re making us guess.

I can see at least one typo in the code above (you need to be more careful) which is “Rigidbody20”. There is no Rigidbody20.

Finally, I would suggest NOT naming your fields/properties the same as the Type name itself i.e. the Type “Rigidbody2D”. You should, for example use “private Rigidbody2D body;” or alternatives like “rb”, “m_Rigidbody2D” etc.

1 Like