You can check “Complete PlayerController” from the following link
ttps://docs.cocos.com/creator/manual/en/getting-started/first-game/#complete-playercontroller
However, I get an error when I use this code.
I think the end of the source code should be “;” or omitted.
However, “.” but some of them don’t give an error. number type might be better.
Yeah, we don’t actually have to terminate statements… some of the engineers on my team do it for readability… but, if you do, use “;” or don’t put anything at all. The “.” after a number is to either specify a floating value or to signify that it is “.0” … nothing follows. Your periods that didn’t throw an error were immediately after an integer… so the computer read it as “.0” Ex. if you had let mynumber = 1. the computer would read it as 1.0… but when you put the decimal point after the parenthesis… you created a syntax error. It didn’t know what to do with your decimal point because it’s not expecting it.
If you want to terminate your statement (the equivalent of ending a sentence with a period in the english language) you can, but you should use “;” instead of a decimal/period. Again, you don’t have to use anything… you absolutely can go to the next line and start your next line of code.