instantiate offset unity
if ( structureIndex == 0 ) { var offset : Vector3 = new Vector3(0.5f, 0.5f, 0); Instantiate(allStructures[structureIndex], lastHitObj.transform.position + offset, Quaternion.identity ); }
instantiate offset unity
if ( structureIndex == 0 ) { var offset : Vector3 = new Vector3(0.5f, 0.5f, 0); Instantiate(allStructures[structureIndex], lastHitObj.transform.position + offset, Quaternion.identity ); }
instantiate offset unity
// C# public GameObject objectPrefab; // ... // Example using Start function void Start() { // Use the prefab's position and rotation Instantiate(objectPrefab, objectPrefab.position, objectPrefab.rotation); // Override the prefab's coordinates (with zero-coordinates) Instantiate(objectPrefab, Vector3.zero, Quaternion.identity); // Provide an offset to the stored values Instantiate(objectPrefab, objectPrefab.position + (Vector3.up * 1.63f), objectPrefab.rotation * Quaternion.AngleAxis(30.0f, Vector3.up)); }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us