#Jump
1 messages · Page 1 of 1 (latest)
thats important
the if statement wont work
if u arent touching the ground
u have to do a debug.log and debug the value of isGrounded
no
have u ever programmed
before
so in order to figure out a value
u wanna debug it not in the if statement
no
not in an if statement
just somewere in update
but ot in an i statement
then put it there
and run it
and heck if isgrounded is true
r u sure u programmed in 2d before
alright well it seems like u dont
we are trying to figure out
the value
of isGrounded
so u want to debug.log
isGrounded
💀
bruh
that will make u jump infinitely
we are tyring to make it
so that
u jump only when u are touching the ground
💀
IM REITERATING
💀
we want u to jump
when u are touching the ground
so what u cando
is debug.log the isGrounded
variable
do u know what the word value is
do u know
what a variable is
what does a variable hold
its a simple question
what does a variable hold
yes or
a value
isGrounded
is a variable
u want so see what is represents
u want to see
if isGrounded is true
or false
so u want to debug that variable
💀
u have to think about it
u want to see
if the variable
called
isGrounded
is true or false
how would u do that
then u havent programmed before
debug.log is the same thing as print
u dont need +
u just need to find the value
of isGrounded
doing what i am suggesting IS NORMAL
u are printing
the value of a variable
debug.log(isGrounded)
thats it
u are printing the variable
@lusty jolt u cant just follow a tutorial
u have to understand
what u are doing
and in the game are u touching the ground
then we found the issue
there is an issue with ur raycast
groundcheck
did u add a layermask
thats ur issue then
add a layermask to the ground object
Hi
U can just do layermaks.getmask
And that’s the easiest thing
And then put the string as the layer u set in the editor
No
No layermask variable
Inside of the raycast function
For the layermask argument
Do layermask.getmask
And then the argument is the name of the layer u set for the ground
No
For the layermask argument
Do u know what an argument is
Layermask is a class
LayerMask
Generally classes are uppercase
Do you know what a function is
Alright u will not be able to make games
If u don’t know the basics
Not basics
FundementLs
Yes and yet you don’t know how to call a function
That’s included in it too
Otherwise functions are meaningless
Watch a basics video
Nope
That’s how u make one
Not call
Exactly
Mathf.Sqrt
Is a function
Inside
NO
No
I didn’t finish the sentence
Either way
Look at the math sqrt function
And compare it to ur function
What is ur function lacking
Alright I need you to watch a video on the fundementals of c#
U havent
If u don’t know
How to call a function
These are the most basic fundementals
If u can’t call a function
U haven’t understood it
I’m not trying to be mean but it’s frustrating for me to help
When you don’t understand the fundementals
U can’t game develop
Without this knowledge
Watch c# fundementals
Not unity
Very programming language
Calls functions
That’s fine. But in order to game develop
U need this knowledge
It’s a requirement
Ur parents will believe u
Once u will accomplish it. U will feel so happy
But this is the uphill part
Don’t let this programming bring u down
Just watch a c# fundementals video
Its@impossible for us to help
If u don’t get what we are trying to say
It’s as if I’m explaining an answer to u in Spanish
U can take the answer
But u won’t understand it
@near crescent is that an accurate analogy
Yes
Whatsup
Nice job
Instead of doing that tho
U can just make the getmask function
Inside of the raycast function
In the raycast function put the stuff on the right of the equal sign. On the part that requires a layermask
It’s cleaner
IMO
And easier to debug
Alright well that won’t work
Bc u made it a local variable
Call it
Outside the function
And before the raycast function
U want to make that variable
Before u do a raycast
Yo
Back
Um no
U made the variable
But u didn’t put it in the function
@lusty jolt
bruh