ConstantVelocity

From Unify Community Wiki
Revision as of 12:16, 8 November 2007 by Opless (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


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>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox