ConstantVelocity
From Unify Community Wiki
(Difference between revisions)
(New page: Category: MonoBehaviour Category: CSharp Category: ReallySimpleScripts Author: Opless == Description == Useful for missiles, grenades, etc == CSharp - ConstantVelocity.cs ...) |
m |
||
Line 1: | Line 1: | ||
[[Category: MonoBehaviour]] | [[Category: MonoBehaviour]] | ||
− | [[Category: | + | [[Category: C Sharp]] |
[[Category: ReallySimpleScripts]] | [[Category: ReallySimpleScripts]] | ||
Revision as of 13:53, 8 November 2007
Author: Opless
Description
Useful for missiles, grenades, etc
CSharp - ConstantVelocity.cs
<csharp> using UnityEngine; using System.Collections;
public class ConstantVelocity : MonoBehaviour {
public Vector3 direction = Vector3.forward;
// Use this for initialization void Start () { }
// Update is called once per frame void Update () { rigidbody.velocity = transform.rotation * direction; } }
</csharp>