Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question I need help to check if the player is grounded or not

Discussion in 'Physics' started by SpaiCrab, Oct 4, 2020.

  1. SpaiCrab

    SpaiCrab

    Joined:
    Feb 14, 2020
    Posts:
    2
    Okay so first of all, i use Bolt, which really has been more of a problem than help and i think i should stop using it. In my game i want the player character to be a square that kind of rotates, like a circle. Since when it rotates only the edges touch the ground but pretty rarely, jumping is awkward when moving. What is a simple way to calculate the distance between the center of the player and the colliders below? I tried raycasts, but i have no idea how to get them to work on Bolt, they always count as true no matter the distance i set.
     
  2. David42142

    David42142

    Joined:
    Jul 15, 2015
    Posts:
    13
    I have no idea about Bolt, but I suppose its possible to use Layer Masks there? In that case exclude the Layer your player is using from the Raycast
     
  3. SpaiCrab

    SpaiCrab

    Joined:
    Feb 14, 2020
    Posts:
    2
    I already tried that, but i literally have no idea how to use Raycasts inside of Bolt, since everything i find when googling is normal scripts! I want it to be a specific length and check if it hits the ground or not but the distance option didn't change anything, it literally seems to change only if i make it 0