myAction.AddCompositeBinding("1DAxis") // Or just "Axis" 1D AxisĪ composite made up of two buttons, one pulling a 1D axis in its negative direction and one pulling it in its positive direction. There are currently four composite types that come with the system out of the box: 1D-Axis, 2D-Vector, Button With One Modifier and Button With Two Modifiers. myAction.AddCompositeBinding("Axis(wichSideWins=1)") This means that several consecutive entries in InputActionMap.bindings or InputAction.bindings together form a composite.Ĭomposites can have parameters, just like interactions and processors. myAction.AddCompositeBinding("Axis")Įach composite is comprised of one binding with set to true and then one or more bindings immediately following it that have InputBinding.isPartOfComposiste set to true. In code, composites can be created using the AddCompositeBinding syntax. To see how to create composites in the editor UI, see here. Composites themselves do not bind directly to controls but rather source values from other bindings that do and synthesize input on the fly from those values. bindings that are made up of other bindings. This problem is solved by "composite bindings", i.e. It is possible to bind a ButtonControl to an action expecting a Vector2 but doing so will result in an exception at runtime when trying to read a Vector2 from a control that can deliver only a float. The problem is that with "normal" bindings, this cannot be solved easily. Another example is using two keys to form a 1D axis equivalent to a mouse scroll axis. The most common example of this is using the W, A, S, and D keys on the keyboard to form a 2D vector control equivalent to mouse deltas or gamepad sticks. Sometimes it is desirable to have several controls act in unison to mimick a different type of control. A flat list of bindings for all actions in a map can be queried from an action map using InputActionMap.bindings. The bindings to a particular action can be queried from the action using InputAction.bindings. Whether the binding is part of a composite. Most importantly used to identify part names inside composites. Can be used, for example, to identify the binding when storing binding overrides in user settings. If, for example, you put a stickDeadzone processor on a binding and then bind it to /leftStick, you will get deadzones applied twice, once from the deadzone processor sitting on the leftStick control and once from the binding.Įxample: "invert axisDeadzone(min=0.1,max=0.95)" Note that processors applied to bindings apply in addition to processors applied to controls that are providing values. Note that processors applied to the action itself (if any) will get appended to this list. Case-insensitive.Ī semicolon-separated list of processors to apply to input on this binding. Note that interactions applied to the action itself (if any) will get appended to this list. Case-insensitive.Ī semicolon-separated list of interactions to apply to input on this binding. Binding groups can be anything but are mostly used for control schemes. Case-insensitive.Ī semicolon-separated list of binding groups that the binding belongs to. Note that this can be null or empty (e.g. The name or ID of the action that should be triggered from the binding. If you want to get the path which is currently being used (ie, either path or overridePath), you can query the effectivePath property. If it is set to something other than null, it will take effect and override path. Unlike path, overridePath is not persistent, meaning that it can be used to non-destructively override the path on a binding. An action can have arbitrary many bindings pointed at it and the same control may be referenced by multiple bindings.Įach binding has the following properties: PropertyĬontrol path that identifies the control(s) from which input should be received.Ĭontrol path that overrides path. An InputBinding represents a connection between an action and one or more controls identified by a control path.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |