Removed

Component.constantForce

Obsolete Property constantForce has been deprecated. Use GetComponent<ConstantForce>() instead. public Component constantForce;

Description

The ConstantForce attached to this GameObject. (Null if there is none attached).

using UnityEngine;

public class Example : MonoBehaviour { void Start() { GetComponent<ConstantForce>().relativeForce = new Vector3(0, 0, 1); } }

Did you find this page useful? Please give it a rating: