❔ im extremely new to c#/unity, i can't find the issue with this code
the transform.Translate line has the syntax error, ',' expected error, and i cant find the issue
40 Replies
Vector.3.back
Should that just be
Vector3.back
?ohh my bad
thank you
yep im just dumb
sorry
im rly new to this 💀
yo like while im on the topic
the whole script has no errors but it dont work
did you attach the script to the player?
the script itself should indeed work if its attached to the game object (tho for W and S u want the vertical axis i would assume)
the code doesnt make sense
for example
Input.GetAxis("Horizontal")
will always return 0 unless you hold down the key that is mapped to itthe question is, did you map the horizontal axis to D and A like in this image?
ill check that one sec
its attached, doesnt work
how tf do i even get here 😭
yes
ok so what should i do about that
can you show a screenshot to that
ensure Update method is being called
use Debug.Log or something
alr
1s
where do i see the debug outcome
in where the error messages window
i didnt get any errors running it
ok i see it
yeah the updates are being called
now try to debug if the getkeydown is being called and debug the values that are placed in the Translate method
ok
A and D work
W doesnt
neither does S
define doesnt work
uh
debug message not showing up
where did you place the debug.log ?
so when you press/hold S, it doesnt print ?
yep
weird
same with W
but not A and D
thast what im saying
btw for S and W it should be
Input.GetAxis("Vertical")
not Input.GetAxis("Horizontal")
okay
rly
casue im tryna do a 3d WASD movement thing on the ground
not flying
did you save the file?
yeah
usually u save with ctrl + s
i go to file and press save then go back to unity
very weird
yeah fr
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.