very basic here: i want to be able to instantiate cubes as childs of my gameObj and move them toghether.
this is just testcode: i want to instantiate a cube object and then apply a force to my current object. the cube should follow, right? no, it doesnt. (gravity is off)
public Transform cube;
Transform newCube;
Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
newCube = (Transform)Instantiate(cube, transform.position + Vector3.left, transform.rotation);
newCube.parent = transform;
}
void FixedUpdate()
{
rb.AddForce(Vector3.forward);
}