forked from cgvr/DeltaVR
generated objects are grabbable and scalable
This commit is contained in:
@@ -67,17 +67,19 @@ public class ShapeDetectionMinigameController : MonoBehaviour
|
||||
|
||||
private void InitializeSpawnedObject(GameObject spawnedObject)
|
||||
{
|
||||
Rigidbody rigidbody = spawnedObject.AddComponent<Rigidbody>();
|
||||
GameObject spawnedObjectParent = new GameObject("SpawnedModelParent");
|
||||
spawnedObjectParent.transform.parent = modelSpawnPoint;
|
||||
spawnedObjectParent.transform.position = modelSpawnPoint.transform.position;
|
||||
Rigidbody rigidbody = spawnedObjectParent.AddComponent<Rigidbody>();
|
||||
rigidbody.isKinematic = true;
|
||||
|
||||
//spawnedObject.AddComponent<NetworkObject>();
|
||||
//spawnedObject.AddComponent<NetworkTransform>();
|
||||
spawnedObject.transform.parent = modelSpawnPoint;
|
||||
spawnedObject.transform.position = modelSpawnPoint.position;
|
||||
|
||||
spawnedObject.transform.parent = spawnedObjectParent.transform;
|
||||
spawnedObject.transform.position = spawnedObjectParent.transform.position;
|
||||
spawnedObject.tag = shapeScannerTag;
|
||||
|
||||
spawnedObject.SetActive(true);
|
||||
|
||||
spawnedObject.AddComponent<XRGrabInteractable>();
|
||||
spawnedObjectParent.AddComponent<TwoHandScaleGrabInteractable>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user