playMaker

Author Topic: Set Variable of a script from an FSM  (Read 1388 times)

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Set Variable of a script from an FSM
« on: December 21, 2013, 02:53:14 PM »
Hi;
I have an gameobject ("MasterCameraRig") that has a script on it called "MasterCamera". The script requires a gameobject variable called "Player". The scene is called after a previous scene where the user chooses a character to play with (previous scene is called "Dressing Room").  In my current scene ("City") I have an FSM that loads a player gameobject as part of the scene loading.  The "MasterCamera" script is part of an add-on, so I don't want to change any code within it because it would get overwritten if I upgrade the add-on.

I need to be able to set the "Player" gameobject variable based on the character chosen but I can't figure out how.

What is the best way to do this -

Sandi

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Variable of a script from an FSM
« Reply #1 on: December 26, 2013, 09:13:59 AM »
Hi,

 Use the "set property" action and target that component where it has this "player" property.

Bye,

 Jean