Search Results

Found 2 results for "6e2303fbc31883a306535fe503355901" across all boards searching md5.

Anonymous /vg/534687374#534713285
8/10/2025, 8:26:12 PM
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<Rigidbody>();

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

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
Anonymous /vg/534571409#534605810
8/9/2025, 10:50:35 PM
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