I have this code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeTest : MonoBehaviour {
public string Hello;
float life = 100;
public float speed = 1.5f; //vitesse cube
public Rigidbody cube;
// Use this for initialization
void Start () {
Debug.Log (Hello + "You have" + life + "%");
cube = GetComponent<Rigidbody> ();
cube.mass = 2;
cube.drag = 0;
cube.isKinematic = false;
cube.AddForce (Vector3.up * 10);
}
// Update is called once per frame
void Update () {
transform.position += new Vector3 (0, 2, 0) *Time.deltaTime;
}
}
With this, I just want make my GameObject(cube) fly in the air and it make this:
I found one solution is to take off the *Time.delta.time
but it doing this: