I'm making a 3d game, and I have only made games in 2D before, but i have used blender before too. My player can now walk and jump, but he is not limited to only jumping of the ground. In 2D, you separated ground objects in a collision layer, and in the jump method you add an if statement like this

    //do the stuff

Apparently this is designed for 2d only.

How do I do this in 3d?

  • 1
    \$\begingroup\$ Did you search for existing Q&A on ground checks / grounded state in Unity or existing guides and tutorials to follow? This is something that's been covered hundreds of times before. What did you try based on your research, and where specifically did you run into trouble? \$\endgroup\$ – DMGregory Aug 20 '19 at 2:19
  • \$\begingroup\$ I checked the Q&A and found an answer. it was in the question, "How to stop jumping again when character is in air (double jump)?" I had looked before, but hadn't found anything. \$\endgroup\$ – Millard Aug 20 '19 at 13:19
  • \$\begingroup\$ I'm glad you found a solution! I'm marking this question as a duplicate of the one you mentioned for the time being. If you find that the solution you gleaned from that Q&A isn't serving your needs, edit this question to describe what you tried and how it's deviating from what you need, and we can re-open it for new answers. \$\endgroup\$ – DMGregory Aug 20 '19 at 13:26