C
C#8mo ago
owen111

moving a player when holding wd, as, aw

ive got player movement but it isnt working properly (in unity)
No description
12 Replies
Pobiega
Pobiega8mo ago
You are using else if, so only one case can match For handling diagonal inputs, you need to allow more than one case
owen111
owen111OP8mo ago
wdym
Pobiega
Pobiega8mo ago
I mean exactly that
owen111
owen111OP8mo ago
so i dont use else if? oh
Pobiega
Pobiega8mo ago
else only triggers if the if failed so with if + else if + else if + else if, only one of these will ever be executed
owen111
owen111OP8mo ago
what do i use
Pobiega
Pobiega8mo ago
what you probably want is to just remove the else because more than one of these can be true at the same time
owen111
owen111OP8mo ago
ah thanks
Buddy
Buddy8mo ago
$unitybug
MODiX
MODiX8mo ago
If intellisense is not working for Rider / Visual Studio, follow these steps.
Go into Unity Editor -> Preferences -> External Tools -> Set Visual Studio (or JetBrains Rider) as your preferred editor.
Go into Unity Editor -> Preferences -> External Tools -> Set Visual Studio (or JetBrains Rider) as your preferred editor.
Close the editor and re-open it again by double-clicking a script file.
Buddy
Buddy8mo ago
Fix this first
owen111
owen111OP8mo ago
?
Want results from more Discord servers?
Add your server