playMaker

Author Topic: Send float variable from FSM to public float other C# script?  (Read 2334 times)

aLDime

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
    • http://aldimegame.com/
Send float variable from FSM to public float other C# script?
« on: September 01, 2013, 06:13:51 AM »
Hi everybody!
Need send float variable from FSM to public float not Playmaker C# script.. How?

aLDime

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
    • http://aldimegame.com/
Re: Send float variable from FSM to public float other C# script?
« Reply #1 on: September 01, 2013, 11:08:27 PM »
What no one knows how to do it?
Even developers PM? I will prompt you, I need a complete function:
Code: [Select]
GameObject.GetComponent.<ScriptName>().variable;but not it's which are curtailed to Play Mayker!

aLDime

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
    • http://aldimegame.com/
Re: Send float variable from FSM to public float other C# script?
« Reply #2 on: September 02, 2013, 12:02:46 AM »
Developers PM you don't know the truth?:
http://hutonggames.com/playmakerforum/index.php?topic=3490.msg16071#msg16071

Then the answer to one question: In actually think that Unity users can solve all their problems with the Play Maker? Well, if you do not have a working dosih "connector" with a third party scripts?


aLDime

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
    • http://aldimegame.com/
Re: Send float variable from FSM to public float other C# script?
« Reply #3 on: September 02, 2013, 12:33:58 AM »
Everything, himself asked himself replied, as usual:))
Here is a working script - "connector" with your script:

Code: [Select]
using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;

public class ShipSpeedToMotionBlur : MonoBehaviour
{

public PlayMakerFSM behavior;
public string fsmFloat;
public float MultSpeed;

void Update ()
{
MultSpeed = behavior.FsmVariables.GetFsmFloat(fsmFloat).Value; // Get float variable from FSM
GetComponent<MotionBlur>().blurAmount = MultSpeed; // Send float variable from FSM to my script
}
}

Thank you all, and all are free))

PS: Support - not bad to make a similar custom action!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14593
  • Official Playmaker Support
    • View Profile
Re: Send float variable from FSM to public float other C# script?
« Reply #4 on: September 10, 2013, 03:00:57 AM »
Hi,

 Sorry, Unite was on, and I am only about to catch up with 10 pages of pending threads :)

 but I am glad you found a solution for your problem and that are sharing it back ( even if replying to yourself always is a weird experience :) ). It's indeed a very common pattern.

In your case tho, you could get away with the action "Set Property". Have you tried that?

Bye,

 Jean