playMaker

Author Topic: Acessing another script with Playmaker[SOLVED]  (Read 1809 times)

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Acessing another script with Playmaker[SOLVED]
« 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.
« Last Edit: February 24, 2017, 02:22:27 AM by jeanfabre »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Acessing another script with Playmaker
« Reply #1 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.
« Last Edit: February 23, 2017, 03:51:31 AM by krmko »
Available for Playmaker work

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Acessing another script with Playmaker
« Reply #2 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.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Acessing another script with Playmaker
« Reply #3 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.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Acessing another script with Playmaker[SOLVED]
« Reply #4 on: February 25, 2017, 12:25:54 PM »
Cool, I am happy that it worked out! Thanks for letting me know  :)