playMaker

Author Topic: Control Parameter's in other scripts  (Read 3284 times)

pixelpusher

  • Playmaker Newbie
  • *
  • Posts: 4
Control Parameter's in other scripts
« on: April 17, 2015, 01:01:21 PM »
Hi,

I'm not sure if this is possible but can you control a scripts setting value through a FSM? To explain, I'd like to control for example the 'Bloom Threshold' amount on the 'Bloom Script C#' that's been added to a camera. etc etc

Apologies if this is a noob thing to do, I'm quite new to PlayMaker and Unity! Thanks in advance, any tips will be welcomed. :D

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Control Parameter's in other scripts
« Reply #1 on: April 18, 2015, 10:48:13 AM »
Yes you can as long as it is a public variable- the easiest way to do it is using the "set property" action- drop the script in the field then use the popup to access a variable from the script- than use another action in the FSM to control it
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

pixelpusher

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Control Parameter's in other scripts
« Reply #2 on: April 20, 2015, 03:33:49 PM »
Thanks for the reply, I checked that out and that is really useful but I was wanting to control the parameters on a script that's been attached to the object. So for example the Bloom effect added to a camera script etc.

I'm guessing this isn't possible without some magical bridge!

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Control Parameter's in other scripts
« Reply #3 on: April 22, 2015, 06:47:49 AM »
As long as the variables are public you can manipulate them- here's whats available with the Bloom effect with Set Property
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

pixelpusher

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Control Parameter's in other scripts
« Reply #4 on: April 22, 2015, 09:21:17 AM »
Ah, Perfect!

I didn't realise you had to 'drag' the script and choose set property. The script I wanted to change (Hand Held Cam) didn't have any public Vars, but edited the script to make them public so all good!

Thanks loads  :)

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Control Parameter's in other scripts
« Reply #5 on: April 22, 2015, 11:58:00 AM »
Sure thing  :) Glad you got it working
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!