#2D Simple double jump...

1 messages · Page 1 of 1 (latest)

primal ledge
#

I know I sound extremely stupid i just dont understand, The ground check (reset) cant seem to work.

#

Completely new and everything so I am just trying to figure this out for a hobby project with a school buddy! Much appriciated to anyone <3

daring wind
#

@primal ledge What have you plugged into that ontriggerenter event on the left?

#

First thing's first. Make sure your trigger detection is working. Just put a debug log in immediately after so uou at least can see if hit detection is doing anything. Then log after the tag check to see if that is doing anything. So on, so forth, etc.

solid pelican
#

Then to make 2x jump (and not eternal) you add a INT variable. -1 per jump, can jump if > 0.

Resets when isGrounded bool is true.

daring wind
#

He seems to already be using that type of setup. Just his collision isn't working by the seems

solid pelican
#

i dont see the same logic, he only has a true result for ground check. not considering false for anything.

daring wind
#

Ah yeah i just mean his question was less about doublejump logic, and more about why his thing wont reset

solid pelican
solid pelican
#

lately - ive been trying to reduce as much node as possible, so i think this works instantly as well

primal ledge
#

Though it's not giving me my luck 😔

primal ledge
#

I'll Provide a Screenshot

daring wind
#

So I could be wrong, but I don't think you put the object you plan to collide with into the input for OnTriggerEnter2D

#

I think that's the object who queries for collisions with the ground, in this case your character

#

what you collided WITH exactly is what you work out afterwards, when you perform checks on the collider output

#

but yeah, add logs to stuff, I gotta assume if your collision is not working it's probably more to do with colliders and rigidbodies and object settings than anything to do with Unity Visual Scripting

primal ledge
#

nvm I figured it out, I had to toggle 'Is Trigger'

daring wind
#

thought it would be something wrong with the editor/setup, yeah

#

cos the nodes seemed fine

#

Now you have your colliders working, Litoid's stuff will help fill gaps on the rest of your feature

solid pelican
#

I prefer Raycast down and object layer ground.

#

Instead of colliders enter/exit

#

Raycast is a thin line shot from origin to direction (from player to down) and if it hits something (objects marked as ground) then raycast says "hey i hit ground!"

#

I try to avoid colliders unless its things bumping into each other.

Its faster coding than using colliders specially in uVS