What I mean is, when my character moves it feels slippery like they still move after you let go of the move button
This is my script
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
public class Movement : MonoBehaviour
{
//Grounded Value
bool isGrounded = false;
Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
if (Input.GetKey(KeyCode.A))
{
rb.AddForce(-1000 * Time.deltaTime, 0, 0);
}
if (Input.GetKey(KeyCode.D))
{
rb.AddForce(1000 * Time.deltaTime, 0, 0);
}
if (Input.GetKey(KeyCode.Space) && isGrounded)
{
rb.AddForce(0, 10000 * Time.deltaTime, 0);
}
}
void OnCollisionEnter(Collision collide)
{
if (collide.gameObject.tag == ("ground"))
{
isGrounded = true;
Debug.Log("Grounded");
}
}
void OnCollisionExit(Collision collide)
{
if (collide.gameObject.tag == ("ground"))
{
isGrounded = false;
Debug.Log("Airborn");
}
}
}
I noticed that you're making a 2D game, but you're using 3D Physics. Is this intentional?
– mbro514