so i got help from someone about a cube maintaining a constant speed and now my cube gently floats down i have a jump script and the velocity script here are both
Jump Script:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Rigidbody))]
public class NewBehaviourScript : MonoBehaviour
{
public Vector3 jump;
public float jumpForce = 20.0f;
public bool isGrounded;
Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
jump = new Vector3(0.0f, 2.0f, 0.0f);
}
void OnCollisionStay()
{
isGrounded = true;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
{
rb.AddForce(jump * jumpForce, ForceMode.Impulse);
isGrounded = false;
}
}
}
Velocity Script:
using UnityEngine;
public class Exist : MonoBehaviour {
public Rigidbody rigidbody;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
rigidbody.velocity = new Vector3(0, Physics.gravity.y, 700) * Time.deltaTime;
}
}