Here, I'm using Unity's add force script from the tutorial.
____________
using UnityEngine;
using System.Collections;
public class MoveBox : MonoBehaviour
{
public float pushForce = 1000;
void OnMouseDown() {
rigidbody.AddForce(-transform.forward * pushForce);
rigidbody.useGravity = true;
}
}
__________
No matter where I'm looking at the object, (in first-person) it only adds negative force along the z axis (the blue arrow). How can I change this, so it will add force forward from where I'm looking at it.
↧