changing object size during instantiation!!!

Updated on June 13, 2017 in  [R] Scripts
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on June 13, 2017

Hi lads!!!

Pretty new here!
I have a small game up and running, but I just can’t figure out how to grow an object’s size during instantiation. I want the object grow from nothing to its actual size in about 1 sec when I instantiate it. 

Any answers are appretiated!!! Thx!

  • Liked by
Reply
0 on June 13, 2017

How are you instantiating? Are you putting the instantiated object in a variable?

We need more info to help you. Just some text is not enough. We need your script.

  • Liked by
Reply
Cancel
2 on June 13, 2017

Oh well!!!
I set up a GameObject named hazard1.
I instantiate in a function:

public void InstantiateHazard1 () {

Instantiate (hazard1, transform.position, transform.rotation);

}

 

Guru
on June 13, 2017

Change 

Instantiate (hazard1, transform.position, transform.rotation);

to

GameObject *name* = (GameObject) Instantiate (hazard1, transform.position, transform.rotation);

Where *name* is the name you want the variable to have.

This way you can access the instantiated gameobject by using the variable.

on June 13, 2017

Thx!!!!!

Show more replies
  • Liked by
Reply
Cancel