You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
380 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class autoMove : MonoBehaviour {
  4. public float moveForce;
  5. private Rigidbody rb;
  6. // Use this for initialization
  7. void Start () {
  8. rb = GetComponent<Rigidbody> ();
  9. }
  10. // Update is called once per frame
  11. void Update () {
  12. }
  13. void FixedUpdate(){
  14. rb.AddForce (transform.forward * moveForce * Time.deltaTime);
  15. }
  16. }