Join our Discord Channel
import System;import HutongGames.PlayMaker;@ActionCategory(ActionCategory.Input)@Tooltip("Gets system date and time info and stores it in a string variable")public class JoystickBridge extends FsmStateAction{ //@RequireField @CheckForComponent(typeof(Joystick)) @Tooltip("Store System DateTime as a string.") public var gameObject : FsmOwnerDefault; //@Tooltip("Optional format string. E.g., MM/dd/yyyy HH:mm") public var position : FsmVector2; public var verticalValue : FsmFloat; public var horizontalValue : FsmFloat; private var _comp : Joystick; public function Reset() { gameObject = null; position = null; verticalValue = 0f; horizontalValue = 0f; } public function OnEnter() { var go = Fsm.GetOwnerDefaultTarget(gameObject); if (go == null) { return; } _comp = go.GetComponent("Joystick"); } public function OnUpdate() { position.Value = _comp.position; verticalValue.Value = _comp.position.y; horizontalValue.Value = _comp.position.x; } }
Assets/PlayMaker/Actions/JoystickBridge.js(14,31): BCE0018: The name 'FsmVector2' does not denote a valid type ('not found'). Did you mean 'HutongGames.PlayMaker.FsmVector3'?
Assets/PlayMaker/Actions/JoystickBridge.js(22,17): BCE0005: Unknown identifier: 'position'.