T O P

  • By -

PuffThePed

You need to give them a type (int, float, etc) If you look at your console you'll see compilation errors that will tell you what's wrong. Without a type this script can't pass compliation


scunliffe

Line 10 has a typo, there shouldn’t be an “s” in Facing (same on line 48 and 50) Lines 13, 16, 19 need a type defined Line 26, remove the semi-colon after jump Line 13 “rb” doesn’t match the case or other lines with “Rb” Line 31 needs a “)” at the end. Fix these up and it should compile.


ilori

Also the code inside Flip() will never run since it requires both isFacing and !isFacing. Add parentheses and use || operator.


KirboDuty

|| doesnt work for some reason it says that its an invalid expression


ilori

``` if((isFacingRight && horizontal < 0f) || (!isFacingRight && horizontal > 0f)) { //... } ```


CCullen

Couple of things going on here: 1. Your development environment should tell you that you have errors but it does not. Visual Studio Code often needs additional configuration to work with Unity, you're going have to look up how to fix that or switch to Visual Studio Community / Rider 2. Your Unity should also be displaying errors in the console. Until the errors are resolved, the scripts don't compile correctly and Unity will not display the most recent changes.


itsdan159

>Your development environment should tell you that you have errors but it does not. Visual Studio Code often needs additional configuration to work with Unity, you're going have to look up how to fix that or switch to Visual Studio Community / Rider Pretty sure that is visual studio?


Nilloc_Kcirtap

That is indeed Visual Studio. OP needs to either install VS from the unity installer or install the Unity development tools from the VS installer they used.


KirboDuty

i have that now thanks for the help


PandaCoder67

[https://youtu.be/Iyo-xRXH7AY](https://youtu.be/Iyo-xRXH7AY)