Hello guys. I am trying to send a 1.0f message from one game object to another. Here are the bones of what i am trying to do:
// 1.0f Message from -------------------------
public class TouchButtonTalk : TouchLogic
{
public Controller2D controller2D;
void OnTouchBegan()
{
controller2D.SendMessage("horizontalMove", 1.0f, SendMessageOptions.DontRequireReceiver);
}
}
// Message to -------------------------
public class Controller2D : MonoBehaviour
{
static public float horizontalMove = 0f;
void Update()
{
characterController.Move (moveDirection * Time.deltaTime);
horizontal = horizontalMove;
moveDirection.y -= gravity * Time.deltaTime;
if (horizontal ==0)
{
moveDirection.x = horizontal;
}
}