Sorry, I'm kind of new to this whole thing and trying to learn both Unity and its use of C#. I have overlapping box colliders set up and a trigger on the lower one to allow me to jump through the lower platform. That works fine, and once on the platform, I can jump through it and land on the top, and I can make a singular jump while I am on the platform, but as soon as I jump a second time, I fall right through. Does anyone have any suggestions as to how to go about fixing this? I originally thought it was that the overlap on the two colliders was too much, or that the radius of my ground points were too large, but fixing both of those didn't do me any good. Thanks for the help!
\$\begingroup\$
\$\endgroup\$
3
-
\$\begingroup\$ you are developing for 2D or 3D? \$\endgroup\$– Hamza HasanCommented Dec 21, 2015 at 15:04
-
\$\begingroup\$ Experimented with the collision detection of the player (Switched from discrete to continuous), and found that to fix the problem too! \$\endgroup\$– RainbowElephantCommented Dec 21, 2015 at 15:46
-
\$\begingroup\$ This is the first step friend :) \$\endgroup\$– Hamza HasanCommented Dec 21, 2015 at 15:58
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
8
If you are developing in 2D environment then try to implement Platform Effector
. In you Platform Sprite, attach a BoxCollider2D
and mark check on Used By Effector
and attach Platform Effector 2D
like this, you are all done.
-
\$\begingroup\$ Thanks! That seems like it's helping a lot, but I'm still sort of falling through the platform occasionally. I have two box-colliders set up like this; I assumed that the effector would be used with the collision box instead of the trigger box (Though I did try with the trigger box and it made the platform intangible to the sprite). So far this is my setup: (Sorry, gotta figure out how to incorporate this! One sec) \$\endgroup\$ Commented Dec 21, 2015 at 15:19
-
\$\begingroup\$ Yea, it must not be Trigger \$\endgroup\$ Commented Dec 21, 2015 at 15:20
-
\$\begingroup\$ If I uncheck trigger it doesn't let me walk in front of (through) the platform. Is there a way to fix that? Or do I have to pick which one I'd rather have? \$\endgroup\$ Commented Dec 21, 2015 at 15:21
-
\$\begingroup\$ Your one collider is normal
Trigger
, change, uncheckTrigger
and mark check onUser By Effector
\$\endgroup\$ Commented Dec 21, 2015 at 15:24 -
\$\begingroup\$ (Here's my setup, I don't know if that'll be helpful at all; the bigger lower box is the one I have triggered to allow me to walk through it, the upper one is the one that causes collision) imgur.com/a/fpr4I \$\endgroup\$ Commented Dec 21, 2015 at 15:25