#problem with player movement

1 messages · Page 1 of 1 (latest)

viscid night
#

Vector3 my_input = new Vector3(input.GetAxis("Horizontal"), 0, input.GetAxis("Vertical"); when i save the code is showing this error message:
Assets\playermovement.cs(22,101): error CS1026: ) expected

sleek schooner
#

The error message literally mentions what's wrong with that code

viscid night
#

im new to unity

sleek schooner
#

It says ") expected", means that you're missing a ")", which should be added at the end of the code

#

Try counting the number of the "(" and ")" in that code, they don't have equal amount of them

viscid night
#

ok ty

sleek schooner
#

You're welcome

viscid night
#

i dont understand can you please help me?

viscid night
#

what do you mean by ")"

#

where i am missing one

#

i cant see it

viscid night
#

how many "(sdasdasd)" i have there?

#

("dsadsd")

#

i have 2

sleek schooner
#

Your code contains 3 "(" and 2 ")", which makes the code gives out an error

viscid night
#

i need to delete them?

viscid night
#

where im missing a ")"

sleek schooner
#

There's a "(" after Vector3, then there are brackets surrounding "Horizontal" and "Vertical", but there's no ")" to pair it up with the first "("

viscid night
#

ohhhhhh

#

so where i need to put ")"

#

hello?

#

ok im closeing the post

sleek schooner
#

Put it before the ";"

viscid night
#

?

#

i need to put it like this?

#

vector3("?

sleek schooner
#

You put ")" before the ";"

viscid night
viscid night
sleek schooner
#

No, put an additional closing bracket right before the semicolon

viscid night
#

so like this?

#

("Vector3"),

sleek schooner
#

No, the first pair of brackets need to cover the entire stuffs for Vector3

viscid night
#

Vector3 my_input = new Vector3 input.GetAxis" Horizontal", 0, input.GetAxis "Vertical");

#

like this?

sleek schooner
#

Don't remove the brackets for Horizontal and Vertical

dusk beacon
#

It should look like this:

Vector3 my_input = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
sleek schooner
#

^

viscid night
#

1sec

#

is not working

#

1sec

dusk beacon
#

change the input.GetAxis to Input.GetAxis with capital I

viscid night
#

ok 1sec

#

still

#

not working

dusk beacon
#

all places where it says input should be changed to Input

viscid night
#

ok let me try

dusk beacon
#

Change Getkey to GetKey

viscid night
#

ok

dusk beacon
#

you haven't posted the code for where that error is, but I'm assuming just change from Transform.position to transform.position

#

to get the players transform component

viscid night
#

letss gooooo

#

tysm

#

@dusk beacon + @sleek schooner ty

#

oh

#

sorry for the pin

#

how is called

#

bro i cant move

#

lol

#

i can move

#

i was just floating

#

ty