Hi there,
we created a little FPS using a CharacterController Component.
The CharacterController works with a Momevement script using “Move”. But using “Move”, the Player must be grounded. Therefore we tried to position our Player model directly on the playground (which is a cube (size= 100,1,100 / position= 0,0,0).
Because of the position of our playground, we believe that the Player model has to be positioned at (0 , 0.5 , 0). Nevertheless is doen’t matter how wo position our Player…it is never grounded (CharacterController .isGrounded = true). Using the unity inspector during playmode, I can see that.
Therefore I used the following Code in Update-function to bring our Player “on the Floor”:
if (!myController.isGrounded)
{
myController.SimpleMove(Vector3.down * Time.deltaTime);
}
That works…but I thinks I get other Problems through this afterwards.
So using this Code, I found out the “correct” Y-Position for my Player model to be grounded:
Look at this strange Y-value…
So here is my question:
HOW can I position a game Object directly onto ground so that isGrounded=true and WHY does unity show strange y-numbers when I use Code to “pull” my Player onto ground?**
Many thanks in advance for your help.
Best regards, Eyanosa