Unity

Unity Move Forward of Object Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveForwardTranslate : MonoBehaviour
{
    Rigidbody m_Rigidbody;
    public float m_Speed;
    void Start()
    {
        m_Rigidbody = GetComponent<Rigidbody>();
        m_Speed = 0.0f;
        
    }
    void Update()
    {
        transform.Translate(Vector3.forward * m_Speed * Time.deltaTime);
        
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

September 2020
M T W T F S S
« Jul   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

Site Statistics

  • Users online: 0 
  • Visitors today : 13
  • Page views today : 13
  • Total visitors : 3,981
  • Total page view: 4,456