Hi Everybody,
I have a problem with playercontroller. When I start a game it works fine (in FixedUpdate). But when my player is killed and I am restarting a scene something is wrong. My player is jumping like 1/5 of a force it is supposed to jump. I have no clue what is happening. Below is my script for moving a player
void RuchGracza()
{
if (isOnGround)
{
playerRB = GameObject.Find(“Player”).GetComponent();
if (Input.GetKey(KeyCode.W))
{
playerRB.AddForce(Vector3.up * wysSkoku, ForceMode.Impulse);
}
if (Input.GetKey(KeyCode.D))
{
playerRB.AddForce(Vector3.up * wysSkoku, ForceMode.Impulse);
playerRB.AddForce(Vector3.right * wysSkoku, ForceMode.Impulse);
}
if (Input.GetKey(KeyCode.A))
{
playerRB.AddForce(Vector3.up * wysSkoku, ForceMode.Impulse);
playerRB.AddForce(Vector3.right * -wysSkoku, ForceMode.Impulse);
}
}
}