- Home /
Question by
unity_yk3ZkvcfEpgdrw · Nov 25, 2019 at 12:11 AM ·
c#treetrees
How can I change some tree's radius and length in C# script?
So, I have this little plant stem here. It only has its initial node.
All I would like to do is make it grow in length and radius in Update(). How can I do that?
screenshot-2019-11-24-at-210914.png
(114.2 kB)
Comment
Answer by Marker_R · Dec 02, 2019 at 06:36 PM
I made a simple script for example when the object who have the script growing up every second by Time.DelataTime.
public float GrowUpSpeed;
public float growScale_X;
public float growScale_Y;
public float growScale_Z;
void Update()
{
growScale_X += Time.deltaTime * GrowUpSpeed;
growScale_Y += Time.deltaTime * GrowUpSpeed;
growScale_Z += Time.deltaTime * GrowUpSpeed;
transform.localScale = new Vector3(growScale_X, growScale_Y, growScale_Z);
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Tree render distance. 1 Answer
trying to create a script to cut down trees but once i cut down the first tree it starts bugging 1 Answer
Physics Materials on SpeedTree? 0 Answers