#2D Simple double jump...
1 messages · Page 1 of 1 (latest)
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
@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.
Check this i made before. It has a flawless performing groundcheck.
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.
He seems to already be using that type of setup. Just his collision isn't working by the seems
i dont see the same logic, he only has a true result for ground check. not considering false for anything.
Ah yeah i just mean his question was less about doublejump logic, and more about why his thing wont reset
well, as i said, ground is acting upon true statement, not what happens when its false. i see that incomplete and a possible reason it's not "resetting"
In there, here's the nodes to detect ground yes or no. and I use that bool to determine what happens. can be changed to whatever is needed
lately - ive been trying to reduce as much node as possible, so i think this works instantly as well
It's a object named groundcheck (attached to the player) so it checks when that box hits the ground it'll reset
Though it's not giving me my luck 😔
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
What kinda logs do I add since I am actually new and Idk about this at all
nvm I figured it out, I had to toggle 'Is Trigger'
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
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