Inconsistent Jump Heights C# - YouTube I am using a raycast to check for Ground and it made my jumps all inconsistent, how can I fix this? here is my code public class PlayerController : MonoBehaviour{ [SerializeField] private L - Pastebin.com
It looks like the force applied to the rigidbody is dependent on how long the object believes it’s colliding with the ground. So if the object quickly realises that it is no longer touching the ground then the resultant force is less than if it takes some time to realise that it is no longer grounded. Some things that might affect this is the use of the Update method rather than FixedUpdate, the use of Input.GetKey() rather than Input.GetKeyUp(), and also that due to the raycast length restriction it might not be colliding properly. Better I think to have an infinite length to the raycast then check the distance with Vector2.Distance() inputting only the y axis of each object to ensure the distance only takes into account the y axis and not the x.