Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: unearthly on February 27, 2017, 06:03:22 AM

Title: Set duration of a game object
Post by: unearthly on February 27, 2017, 06:03:22 AM
Hi

I have used an activate game object action on an FSM to show a gun smoke sprite. It is not triggered by a key or mouse press because I only want it active when the gun has ammo. That works fine, but the sprite hangs in the air too long.

I would like to control it's duration (to about a half second). I think I should be able to do that though a float variable. How could I go about it?
Title: Re: Set duration of a game object
Post by: tcmeric on February 27, 2017, 01:50:00 PM
Have you tried to action "Wait" ?

Here is a basic tutorial. Wait can take a variable:
Title: Re: Set duration of a game object
Post by: che1974 on February 27, 2017, 03:48:41 PM
Here is a custom Action. I think this will help.
Destroy self with a Delay you want.


Title: Re: Set duration of a game object
Post by: unearthly on February 27, 2017, 06:27:56 PM
Thanks again tcmeric.

Used my activate game object (plus a random rotate) with a wait of .1 seconds. Works fine.
I tend to over complicate my fsm's and I had unnecessary actions attached to different states.

che1974 I have downloaded your custom action. To use would I need a create object action followed by your destroyself2 to make my gun smoke?
Title: Re: Set duration of a game object
Post by: che1974 on February 28, 2017, 07:57:27 AM
Yes, my Idee was to spawn(Smoking, Explosion,...) and destroy after delay.