Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: aLDime on September 01, 2013, 09:13:51 AM

Title: Send float variable from FSM to public float other C# script?
Post by: aLDime on September 01, 2013, 09:13:51 AM
Hi everybody!
Need send float variable from FSM to public float not Playmaker C# script.. How?
Title: Re: Send float variable from FSM to public float other C# script?
Post by: aLDime on September 02, 2013, 02:08:27 AM
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!
Title: Re: Send float variable from FSM to public float other C# script?
Post by: aLDime on September 02, 2013, 03: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?

Title: Re: Send float variable from FSM to public float other C# script?
Post by: aLDime on September 02, 2013, 03: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!
Title: Re: Send float variable from FSM to public float other C# script?
Post by: jeanfabre on September 10, 2013, 06: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