Skip to content

New example #866

@arifinwandagau987-cyber

Description

using UnityEngine;

public class PlayerJump : MonoBehaviour
{
public float jumpForce = 7f;
private Rigidbody2D rb;

void Start() {
    rb = GetComponent<Rigidbody2D>();
}

void Update() {
    if (Input.GetKeyDown(KeyCode.Space)) {
        rb.velocity = Vector2.up * jumpForce;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions