better isFalling detection
This commit is contained in:
		@@ -108,14 +108,14 @@ public class PlayerController : MonoBehaviour
 | 
			
		||||
    {
 | 
			
		||||
        if (jump)
 | 
			
		||||
        {
 | 
			
		||||
            Debug.Log("Jump");
 | 
			
		||||
            // Debug.Log("Jump");
 | 
			
		||||
            rb.AddForce(transform.up * jumpSpeed * 100 * Time.deltaTime, ForceMode.Impulse);
 | 
			
		||||
            jump = false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(rb.velocity.magnitude != 0 && rb.velocity.normalized == this.downDirection.normalized)
 | 
			
		||||
        if(rb.velocity.magnitude != 0 && Vector3.Dot(rb.velocity.normalized, Physics.gravity.normalized) > 0 )
 | 
			
		||||
        {
 | 
			
		||||
            // Debug.Log("Player is falling :)");
 | 
			
		||||
            Debug.Log("Player is falling :)");
 | 
			
		||||
            this.isFalling = true;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
@@ -148,7 +148,7 @@ public class PlayerController : MonoBehaviour
 | 
			
		||||
 | 
			
		||||
        if (pushObject != null)
 | 
			
		||||
        {
 | 
			
		||||
            PlatformManager platform = pullObject.GetComponent<PlatformManager>();
 | 
			
		||||
            PlatformManager platform = pushObject.GetComponent<PlatformManager>();
 | 
			
		||||
            if (platform != null)
 | 
			
		||||
            {
 | 
			
		||||
                float step = platform.speed * Time.deltaTime * 10f;
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ public class ProceduralGeneration : MonoBehaviour
 | 
			
		||||
        float horizontalDistancePerPlatform = (float)Random.Range(1.0f, levelBlocks.Count); ;
 | 
			
		||||
 | 
			
		||||
        List<GameObject> levelBlocksSpawnTemp = new List<GameObject>();
 | 
			
		||||
        Debug.Log("Building LOOP");
 | 
			
		||||
        // Debug.Log("Building LOOP");
 | 
			
		||||
 | 
			
		||||
        int pieceCount = 10;
 | 
			
		||||
        float radius = (pieceCount / 2) * 2;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user