#2D collision | ground check
1 messages · Page 1 of 1 (latest)
What shape is your 2d character?
probably create a LayerMask, it might be hitting itself
(collider wise)
it's a square
Seems questionable to use CircleCast instead of BoxCast. Try seeing if it makes the collision more reliable.
It’s as easy as public LayerMask mask; then in the circle cast (origin, radius, direction, mask)
Okay, I just did that and it still doesn't work.
Do you have infinite jumps or no jumps now?
Why would that change anything? I have an empty at the bottom of the box and a tiny circle cast should do the same as a tiny square cast?
still infinite
direction, distance, mask
what's distance if you have radius?
not sure I get you
https://docs.unity3d.com/ScriptReference/Physics2D.CircleCast.html
A CircleCast is conceptually like dragging a circle through the Scene in a particular direction.
Make sure to assign the Layer Mask varaible in the inspector to the Layer Mask the ground uses.
This is what I see
Oh wait
I didn’t read 😅
I have done that, still infinite. I'm starting to think that the empty areas of the tilemap also count in the layer, creating the infinite jumps
i'll send a screenshot maybe that'll help
My thought is that the middle area wich shouldn't be ground also counts as ground
@thin pebble ?
I might be completely wrong on that, so if you have another hunch, let me know please
Honestly? I don't have any idea what causes the issue.
well, have you worked in 2d with tilemaps before? if so, what's your workflow?
It's been a long time since I made a 2d game. I'll set something up real quick then describe how I did it.
Much appreciated :)
@thin pebble actually, sorry I haven't told you this before, but if you think calling and me screensharing would be easier, we can do that as well
Sure. I love to screen share, and I have just about completed my example actually (note the tiles will be ugly!)
Should we DM vc? We might get interrupted here