I'm sorry.
In the following code,
the "public float power" that is stored in the value used in playmaker possible?
-------------------------------------------------------------------------------------------
using UnityEngine;
using System.Collections;
public class ForceToBall : MonoBehaviour {
public GameObject followCamera;
public float power;
GameManager gm;
// Use this for initialization
void Start () {
gm = GameObject.Find ("/GameManager").GetComponent<GameManager>();
}
// Update is called once per frame
void Update () {
if(gm.isReady) {
gameObject.rigidbody.isKinematic = true;
if(Input.GetKeyDown(KeyCode.F)) {
gameObject.rigidbody.isKinematic = false;
Force();
}
if(Input.GetKeyDown(KeyCode.DownArrow)) {
if(power>100.0f) {
power += -100.0f;
}
}
if(Input.GetKeyDown(KeyCode.UpArrow)) {
power += 100.0f;
}
} else {
gameObject.rigidbody.isKinematic = false;
}
}
void Force() {
gm.isReady = false;
followCamera.SendMessage("SetSwing");
Vector2 direction = new Vector2(transform.position.x-followCamera.transform.position.x, transform.position.z - followCamera.transform.position.z);
rigidbody.AddForce(new Vector3(direction.x*power, 5.0f*power, direction.y*power));
//rigidbody.AddTorque(new Vector3(100.0f, 0.0f, 0.0f),ForceMode.Force);
GameObject.Find("SoundManager/DriverSound").audio.Play();
}
}
------------------------------------------------------------------------------------------------------------------