Search results for "6e2303fbc31883a306535fe503355901" in md5 (2)

/vg/ - /agdg/ - Amateur Game Development General
Anonymous No.534713285
using UnityEngine;
using UnityEngine.InputSystem;

public class PlayerMovement : MonoBehaviour
{
public float moveSpeed;
public float sprintSpeed;
public float gravity = 9.9f;
public float jumpheight = 5.0f;
private PlayerControls controls;
private Vector2 moveInput;
private Vector3 jumpInput;
public Transform groundCheck;
public float groundDistance = 0.15f;
public LayerMask groundMask;
Vector3 velocity;
private Rigidbody rb;
private bool isGrounded;

private void Awake()
{

controls = new PlayerControls();
rb = GetComponent();

controls.Player.Move.performed += ctx => {
moveInput = ctx.ReadValue();
};

controls.Player.Move.canceled += ctx => {
moveInput = Vector2.zero;
};
controls.Player.Jump.performed += ctx => {
if (isGrounded)
{
velocity.y = Mathf.Sqrt(jumpheight * 2f * gravity); // <-- use this in FixedUpdate
}
};

}

private void OnEnable()
{
controls.Enable();
controls.Player.Enable(); // ensures the action map is active
}

private void OnDisable()
{
controls.Disable();
}
private void OnDrawGizmosSelected()
{
if (groundCheck == null) return;
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(groundCheck.position, groundDistance);
}

>1/2 of my movement code
/vg/ - /agdg/ - Amateur Game Development General
Anonymous No.534605810
Can someone fucking help me with this shit.
I finally got that screen recorder working.
>No problems in my code according to my complier
>THIS happens for no reason
I need to figure this shit out