i have stange bug with physics , when unfreezing parented rigidbodies .
i have made a 1 .
my code for chopping down trees and unfreezing rigidbodies :
using UnityEngine;
using System.Collections;
public class CHOPCHOP : MonoBehaviour {
public Rigidbody body;
public Rigidbody[] crystals;
// Use this for initialization
void Start() {
foreach(Rigidbody crystal in crystals) {
crystal.constraints = RigidbodyConstraints.FreezeAll;
}
}
// Update is called once per frame
void FixedUpdate() {
if (Input.GetKey(KeyCode.T)) {
body.AddForce(Vector3.forward * 5);
foreach(Rigidbody crystal in crystals) {
crystal.constraints = RigidbodyConstraints.None;
}
}
}
}