Jump to content
  • 0

(Zscript) GetAge for a VisualThinker?


Gothic

Question

Is there a way to make a VisualThinker do some stuff after a certain period of time? I tried using "if(GetAge())" but doesn't seem to work with them. Is there another way to do it?

Here's what I'm trying to do:

class FireSprite : VisualThinker
{
	double	RollVel;
	override void PostBeginPlay()
	{
		Super.PostBeginPlay();
		RollVel = randompick(-14.0,14.0);
	}
	override void Tick()
	{
		if (bDESTROYED || IsFrozen())
			return;
		Super.Tick();
		Roll += RollVel;

///this doesn't work apparently////
		if(GetAge() > 10)
		{
			Scale -= (0.015,0.015);
			Alpha -= 0.05;
			if (Alpha <= 0.0)
				Destroy();
		}
////////////////////////////////////
	}
}

 

Edited by Gothic

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 2

For (any non-actor) thinkers, I usually just make an int ctr variable and have a ctr++ on beginning of the Tick() override. Then using the ctr as GetAge() replacement.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...