Again a question.
I was thinking…
Is it possible to make the AddForce relative to a child on the object?
Like position and rotation?
I’ve got the GameObject (Going to name it Motor) with this script:
using UnityEngine;
using System.Collections;
public class Rotation : MonoBehaviour {
public float Rotate = 10.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKey("b"))
transform.Rotate (Vector3.back * Rotate * Time.deltaTime);
}
}
And I want to apply its position and rotation to this AddForce :
GetComponent<ConstantForce>().GetComponent<Rigidbody>().AddForce (-transform.right * aPower * Time.deltaTime);
Is this even possible?
If yes, Please help me.
Thanks for reading!