I’m starting with Unity and C# and got 6 errors:
These are the errors that unity tells me:
1-Assets\vomieneto.cs(9,30): error CS1525: Invalid expression term ‘if’
2-Assets\vomieneto.cs(9,30): error CS1003: Syntax error, ‘,’ expected
3-Assets\vomieneto.cs(17,19): error CS1002: ; expected
4-Assets\vomieneto.cs(38,19): error CS1002: ; expected
5-Assets\vomieneto.cs(38,19): error CS1513: } expected
6-Assets\vomieneto.cs(38,95): error CS1002: ; expected
this is my code:
The line numbers I quote are the ones in your screenshots, not the line numbers in the error messages.
Line 9 should be = 1f; not if;
Line 38 should be rb.MovePosition. That would also account for the invalid “if”
Line 24 should be rb = GetComponent();
Line 44 should be InputValue, not inputvalue
Although we try to help as much as we can, I do think it best if you try and tackle these yourself. Every error message tells you what is wrong. Do look up CS1525, for example and you’ll find help.
I also think that you are not getting you code editor to help you with spelling and syntax. I don’t recognise it and I strongly recommend that you use Visual Studio or Visual Studio Code, both of which are free and work very well with Unity. They will prompt you go get spelling and capitalisation correct.
Two more things. if you are going to post error messages, you should really make sure that the line numbers in the errors match up with the script that you provide. They don’t in this case, which made it harder for me. And, when it comes to giving us the script, use the “Code Sample” button (ones and zeros) rather than screen shots. That will help us by allowing us to copy and paste the code into our own editors to check it.