Compare commits

...

2 Commits

2 changed files with 4 additions and 1 deletions

View File

@ -84,7 +84,7 @@ namespace Passer.Humanoid {
GameObject obj = Instantiate(prefab, socket.transform.position, socket.transform.rotation); GameObject obj = Instantiate(prefab, socket.transform.position, socket.transform.rotation);
obj.name = prefab.name; // Remove the (Clone) obj.name = prefab.name; // Remove the (Clone)
socket.Attach(obj.transform); socket.Attach(obj.transform, false);
if (socket.attachedTransform == null) if (socket.attachedTransform == null)
Debug.LogWarning("Could not attach transform"); Debug.LogWarning("Could not attach transform");
else { else {

View File

@ -327,6 +327,9 @@ namespace Passer.Humanoid {
bool grabHandle = false; bool grabHandle = false;
bool grabHandleInSocket = false; bool grabHandleInSocket = false;
foreach (Collider collider in colliders) { foreach (Collider collider in colliders) {
if (collider == null)
continue;
GameObject obj; GameObject obj;
Rigidbody objRigidbody = collider.attachedRigidbody; Rigidbody objRigidbody = collider.attachedRigidbody;
if (objRigidbody != null) if (objRigidbody != null)