C
C#9mo 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
Pobiega9mo 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
owen111OP9mo ago
wdym
Pobiega
Pobiega9mo ago
I mean exactly that
owen111
owen111OP9mo ago
so i dont use else if? oh
Pobiega
Pobiega9mo 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
owen111OP9mo ago
what do i use
Pobiega
Pobiega9mo 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
owen111OP9mo ago
ah thanks
Buddy
Buddy9mo ago
$unitybug
MODiX
MODiX9mo 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
Buddy9mo ago
Fix this first
owen111
owen111OP9mo ago
?
Want results from more Discord servers?
Add your server