Troubleshooting scriptcode

GetComponent().velocity += new Vector3(2, 0, 0,);
Can anyone identify whats wrong with the script above? Saw a youtuber do the same thing. His script is working but mine is not. System displays ‘invalid expression term’ plz help.

You have an extra comma after the last 0.

1 Like

The error message should have the line number and position in the line like (12, 22). Follow that to track things down.

1 Like

thx