TLDR: I dont think its a script or inspector problem, but rather something from Unity itself that I cant find to adjust
Im using Unity 2018.4.1f1
Even my platform falls really slowly. Its all so odd since another game I have the exact same stuff and its fine with that one, everything is at the typical speed you’d expect. No idea why this one is so slow for.
I have to make certain things bigger too just to make it the same size as the other game. For example, the ground check radius in both games was set to 0.2. you can see it in one game, but its still way too tiny in the other game, where you can’t see it. So I had to make the radius bigger just to get it to the same size as 0.2 in the other game. Here’s the images below of what I am talking about. Here, the size of both will be 0.2: Both are approximately zoomed in the same amount. Look how tiny that is (top image). I had to increase the size a lot to match the 0.2 size of the other game, which Unity seems normal there.
So I don’t know why this game is so messed up for, from that to the slow jumping and what not. The characters are the exact same size though.
But anyway, theres the script and Inspector from the game where its all messed up on:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WizardPlayerController : MonoBehaviour
{
private Renderer rend;
private Color colorToTurnTo = Color.blue;
float dirX;
public float runSpeed;
public float spead = 2f;
public float jumpForce = 16.0f; //how high the character jumps
private float movementInputDirection; //the key being pressed down
private int facingDiection = 1; //-1 is left. 1 is right
private int amountOfJumpsLeft;
private bool canMove;
private Rigidbody2D rb;
private bool isFacingRight = true;
private bool canJump;
private bool isGrounded;
private bool isAttemptingToJump;
private bool canFlip;
private bool checkJumpMultiplier;
public Transform groundCheck;
public float checkRadius;
public LayerMask whatIsGround;
private float moveHorizontal;
private float moveVertical;
public float movementSpeed = 10.0f;
public float movementForceInAir; //add force to character as its attempting to move in the air
public float groundCheckRadius;
public LayerMask WhatIsGround;
private Vector2 speed;
//-----------------------------------------------------------------------------
//--------------------------------------------------------------
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
//---------------------------------------------------------
private void Update()
{
CheckInput();
CheckMovementDirection();
CheckIfCanJump();
RunSpeed();
}
//---------------------------------------------------------------------------------
private void CheckInput()
{
movementInputDirection = Input.GetAxisRaw("Horizontal");
if (Input.GetButtonDown("Jump"))
{
Jump();
}
}
private void Jump()
{
if (canJump)
{
rb.velocity = new Vector2(rb.velocity.x, jumpForce);
}
}
//-----------------------------------------------------------------------------------
private void ApplyMovement()
{
rb.velocity = new Vector2(movementSpeed * movementInputDirection, rb.velocity.y);
}
//-----------------------------------------------------------------------------
private void Flip()
{
facingDiection *= -1; //facing left. every time we flip the character it will go back and forth between -1 and 1
isFacingRight = !isFacingRight;
transform.Rotate(0.0f, 180.0f, 0.0f); //x, y, z
}
//------------------------------------------------------------------------------------------------------------
private void FixedUpdate()
{
RunSpeed();
ApplyMovement();
CheckSurroundings();
}
//------------------------------------------------------------
private void CheckSurroundings()
{
isGrounded = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, whatIsGround);
}
//---------------------------------------------------------------------------
private void CheckIfCanJump()
{
if(isGrounded && rb.velocity.y <= 0)
{
canJump = true;
}
else
{
canJump = false;
}
}
//--------------------------------------------------------------------------
//----------------------------------------------------------------------------------
private void CheckMovementDirection() //moves him right or left. flips him so he faces the direction he is going in
{
if (isFacingRight && movementInputDirection < 0)
{
Flip();
}
else if (!isFacingRight && movementInputDirection > 0) //because he is moving left while facing right
{
Flip();
}
}
//------------------------------------------------------------------------------------------------------------------------------------
private void RunSpeed()
{
if (Input.GetKey(KeyCode.LeftShift))
spead = 10f;
else
spead = 2f;
}
//---------------------------------------------------------------------------------------------------------------------------
private void OnDrawGizmos()
{
Gizmos.DrawWireSphere(groundCheck.position, groundCheckRadius);
}
}