public class Items : MonoBehaviour
{
Rigidbody rb;
public bool sweatBandsItem = false;
// Use this for initialization
void Start ()
{
rb.GetComponent<Rigidbody> ();
}
// Update is called once per frame
void Update ()
{
if (sweatBandsItem == true)
{
gameObject.FindWithTag("PushZone") = RigidbodyConstraints.None;
}
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("SweatBands"))
{
other.gameObject.SetActive (false);
sweatBandsItem = true;
}
}
}
I’m having issues with unfreezing the position of a rigidbody. What I’m specifically trying to do is have my character able to push a cube after picking up an item (which I have working) and then unfreezing the rigidbody positions of all cubes with the tag “PushZone”. I’ve tried several approaches and the one I’ve posted above was the last attempt. The vast majority of google searches have led me to outdated methods, and the few that weren’t outdated simply didn’t work for me. Any advice would be appreciated.