1. Hello, I can get the current height of a foundation; but I was wondering if it is possible to modify the height of the foundation so that you can increase or decrease the height like in the screenshot. 2016-02-20_00001.jpg
    [DOUBLEPOST=1455996615,1455936142][/DOUBLEPOST].

    This is the code that I used to achieve what I wanted:
    Code:
    building_block.transform.position += new Vector3(0, 1, 0);
    building_block.transform.position -= new Vector3(0, 1, 0);
    
    UPDATE:

    Hello, I can (now) change the height of a foundation (via a plugin I am working on). However, the visible height of the foundation doesn't change until you manually 'update' it by, for example, upgrading the foundation. I was wondering how I can 'update' the foundation after changing its height.
     
    Last edited by a moderator: Feb 21, 2016
  2. Calytic

    Calytic Community Admin Community Mod

    Code:
    block.transform.position.y - 1
    block.transform.position.y + 1
     
  3. I get an error that says
    Code:
    Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement.
    But if I assign it to a temporary variable then the height of the foundation won't increase (or decrease) permanently.
     
  4. block.transform.position.y -= 1
    block.transform.position.y += 1
     
  5. After using this I get the following error:
    Code:
    Cannot modify a value type return value of 'UnityEngine.Transform.position'. Consider storing the value in a temporary variable.
     
    Last edited by a moderator: Feb 21, 2016
  6. Hello, I can change the height of a foundation (via a plugin I am working on). However, the visible height of the foundation doesn't change until you manually 'update' it by, for example, upgrading the foundation. I was wondering how I can 'update' the foundation after changing its height.
     
  7. Try building_block.SendNetworkUpdateImmediate(false);
     
  8. I still get the same issue, where i still have to manually 'update' the block.
    [DOUBLEPOST=1456101288][/DOUBLEPOST]
    Would it be possible to force the block to update by, I.E changing its health ? Would you recommend this or is there a better way (or one that works if my suggested method fails)?
     
  9. This is just a simple hack idea, maybe you can upgrade your foundations to the same level that it already exists by calling some methods in your script after object placement? This would refresh object visual data as you mentioned in first post.