#Auto jumping

1 messages · Page 1 of 1 (latest)

willow palm
#

I can't get auto jumping to work.

#

there the thread has opened.

tepid gulch
#

provide context

rich ferry
#

like i said

willow palm
#

not sure if this is what you meant.

#

probably not.

rich ferry
willow palm
#

should it be exactly there?

rich ferry
#

yeah?

willow palm
#

here too?

#

I mean

#

under getkeyup

rich ferry
#

yeah

willow palm
#

anything else or should I test the game now?

rich ferry
#

try it

willow palm
#

k

#

uh

#

if I hold space, it doesn't jump.

#

only when I release it.

#

so should I change it to getkeydown instead?

rich ferry
#

why are you jumping on Input.GetKeyUp

#

i didnt tell you to do that

willow palm
#

I thought so.

#

I'll change it.

rich ferry
#

then stop thinking

willow palm
#

bruh

#

I'm trying to understand what you're telling me to do.

#

which often creates misconceptions.

rich ferry
#

and your also doing random other things

willow palm
#

like?

rich ferry
#

like putting Jump() in getkeyup

willow palm
#

because I saw that in another line.

#

like here.

rich ferry
#

comment that too, i dont think you need that, not sure

willow palm
#

what does () mean?

rich ferry
willow palm
#

ok

#

but why did he make a method called Jump()?

#

I mean isn't it literally called Jump()?

#

and not just Jump?

rich ferry
#

what

#

it has to be () thats not part of the name

#

thats how you create methods in C#

willow palm
#

oh yeah

#

right

#

bro

#

💀

#

I'll just wait.

rich ferry
#

try posting with <> surrounding it

willow palm
#

does dyno only detect it with embeds?

rich ferry
#

no clue

willow palm
#

anyway that's the code.

#

rn

rich ferry
#

...

willow palm
#

lol what

rich ferry
#

wheres the GetKeyUp

willow palm
#

I changed it to getkeydown.

rich ferry
#

for what reason

willow palm
rich ferry
#

literally what

#

yeah?

willow palm
#

I'm confused.

rich ferry
#

jumping means Jump();

willow palm
#

like that?

rich ferry
#

all you want there is make jumpDelay 0

willow palm
#

ye

#

uh now it's the problem again.

#

as always.

#

it seems like I can only jump on a specific tick.

#

or something.

rich ferry
#

what does that mean

willow palm
#

is that jumpCooldown's fault?

willow palm
#

when I press space

#

it rarely actually jumps.

#

like on a specific millisecond I believe.

rich ferry
#

i see why

#

remove line 131 and 132

        //If holding jump && ready to jump, then jump
        if (readyToJump && jumping) Jump();
willow palm
#

oh and yeah it also autojumps after a while when autojump is off.

rich ferry
#

remove && readyToJump on line 165 and remove the readyToJump = false;

willow palm
#

k

#

uh

#

I mean then it's just gonna say

#

if (grounded) {

}

#

right?

rich ferry
#

yes

#

well theres other code inside it

willow palm
#

still the exact same.

willow palm
rich ferry
#

lines 79-96 is what we will change next

willow palm
#

k

#

I have to eat now. Sorry.

#

I'll be right back.

rich ferry
#
        if(Input.GetKey(KeyCode.Space)) {
            jumpDelay += Time.deltaTime;
        }
        if(Input.GetKeyDown(KeyCode.Space) && grounded)
        {
            Jump();
        }
        if (Input.GetKeyUp(KeyCode.Space)) {
            jumpDelay = 0;
        }
        if(jumpDelay >= 1 && grounded) {
            Jump();
            jumpDelay = 0;
        }
``` just this should work
willow palm
#

k

#

I'll try that and then go to dinner.

#

what about the autojump?

#

the toggle.

rich ferry
#

dont need it

willow palm
#

k

#

now it autojumps tho.

#

brb

#

I'm back.

#

anyway so autojump is on.

willow palm
#

ah yes

#

my problem has been solved.