how to instantiate with an offset?

Hey guys, I’m trying to instantiate one object to the position of another but with an offset.

I’ve fudged around a bit;

if ( Input.GetMouseButtonDown (0) && lastHitObj )
   		{
   			if ( lastHitObj.tag == "placementPlane_Open" )
   			{
   				if ( structureIndex == 0 )
   				{
   					Instantiate ( allStructures[structureIndex], lastHitObj.structurePOS, Quaternion.identity );
   					structurePOS = Vector3 ( transform.position.x + .5, transform.position.y + .5, transform.position.z );
   				}

of course this is giving me errors :frowning: I’ve done a search and previous questions answers must not be in javascript because they cough out errors.

First of all, you mis-spelled “structurePOS” in the Instantiate call.

Also, try applying the offset like this:

var offset : Vector3 = new Vector3(0.5f, 0.5f, 0);
Instantiate(allStructures[structureIndex], lastHitObj.structurePOS + offset, Quaternion.identity );