When I put a Grabbable Object near hand and set it to Active False, I can still grab it and will trigger GrabBegin and GrabEnd in NRGrabbableObjects, it that a Bug or a Feature?
My current solution is:
///
/// The grabber.
public void GrabBegin(NRGrabber grabber)
{
if (IsBeingGrabbed || grabber == null)
return;
gameObject.GetComponent().isKinematic = true;
Grabber = grabber;
if (m_OnGrabBegan != null)
{
m_OnGrabBegan();
}
if(gameObject.activeSelf)
{
SendMessageUpwards("StartGrab");
}
}
/// <summary> Grab end. </summary>
public void GrabEnd()
{
m_AttachedRigidbody.isKinematic = m_OriginRigidbodyKinematic;
Grabber = null;
if (m_OnGrabEnded != null)
{
m_OnGrabEnded();
}
if (gameObject.activeSelf)
{
Invoke("SendStopGrabMessage", 0.5f);
}
}