My player, no matter what i ty keeps going through the floor (cube), the player(cylinder) has a rigid body (3d) and the floor has box collider, i’m really stuck because i wrote my first movement script for a fps game and i can’t try it out
It sounds like you may be encountering a common problem when working with physics in Unity: the player’s collider is not properly configured to prevent it from passing through other colliders in the scene. There are a few different ways you can try to fix this issue:
Adjust the collider on the player: The first thing you can try is to adjust the collider on the player object. Make sure that the collider is a good fit for the shape of the player, and that it is not too small or too large. You may also need to adjust the position and orientation of the collider, to ensure that it is properly aligned with the player object.
Adjust the rigidbody on the player: The player’s rigidbody component controls how it responds to forces and collisions in the scene. You can try adjusting the settings on the rigidbody, such as the mass and drag, to see if this helps to prevent the player from passing through the floor.
Use a different collider on the floor: If the player’s collider is properly configured and the rigidbody settings are correct, you may need to adjust the collider on the floor object. In particular, you may need to use a different type of collider, such as a mesh collider, if the player’s shape does not match the shape of the floor.
Use multiple colliders on the floor: Another option is to use multiple colliders on the floor, to better match the shape of the player. For example, you could use a box collider for the main part of the floor, and then use additional colliders, such as sphere colliders, to cover any gaps or holes in the floor where the player might pass through.
the rigidbody might have the wrong values, like you need to lock the rotations of the rigidbody and stuff like that.
There may be something wrong in the components that you are using.
Make sure that both your player and the ground have 3D colliders on them.
On the collider component, make sure that neither of them have “isTrigger enabled.”
Another thing you should probably check it that the objects do not start inside of each other. For example, the player is spawned above the cube, that way the collision detection can start properly.