Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: unearthly on February 22, 2017, 10:53:14 PM

Title: Acessing another script with Playmaker[SOLVED]
Post by: unearthly on February 22, 2017, 10:53:14 PM
Hi,

I have been using a bullet decal asset which uses raycasts with my Playmaker FSM controlled gun fire animations, which is fine except when I don't have any more cartridges to fire the bullet decal component keeps sending out decals on key presses. Is there an action or FSM I can construct to disable the key input within the bullet decal scripts or disable them entirely, then enable them when the gun is reloaded via my Playmaker FSM and fired?

Perhaps there is another approach? I don't know how to code, so if anyone can help I would appreciate it.
Title: Re: Acessing another script with Playmaker
Post by: Fat Pug Studio on February 23, 2017, 03:04:30 AM
You can use set property action, drag and drop the script into slot and find the property you want to manipulate.
Title: Re: Acessing another script with Playmaker
Post by: tcmeric on February 23, 2017, 08:02:25 AM
Which asset are you using specifically?

If the asset is a script on an object, you could disable the object when you run out of bullets (so no more decals are created). The action is "activate game object". You can then re-activate the game object with the script using playmaker when the gun is reloaded.
Title: Re: Acessing another script with Playmaker
Post by: unearthly on February 24, 2017, 02:14:44 AM
Thank you tcmeric.

You have saved me a lot of worry. I am using Advanced Bullet Decals and yes it's attached to a game object. I got it to work with a global variable I had for monitoring cartridges loaded in the magazine, so I used an int compare in a dedicated FSM. Took a little time to figure the best approach, but it now works a treat.

Thanks again.
Title: Re: Acessing another script with Playmaker[SOLVED]
Post by: tcmeric on February 25, 2017, 12:25:54 PM
Cool, I am happy that it worked out! Thanks for letting me know  :)