ConstantVelocity

From Unify Community Wiki
Revision as of 19:20, 19 October 2009 by NCarter (Talk | contribs)

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