Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by InfernalMajesty89 · Nov 06, 2020 at 05:54 PM · state-machinecallbackinput managerbindingactionscript

How do I call InputActions & ActionMap in player code script when I have multiple binding group schemes? with Input System 1.0?

The tutorials and manual go into great detail about mapping bindings, but naturally there are many ways to implement the inputaction scheme groups, and unity seems content to just say call a code snippet for each action in the component. But if you are trying to self-teach coding, you are left to track down the esoteric advanced implementation techniques on your own. I am pressed for time and money, but willing and able to learn; I just don't know where to look sometimes and each new topic calls for comparing dozens of sources from right but skeletal to dry and dense to wrong but compelling.

Does one declare private InputActions.ActionMap for send messages & invoke events? In 1.0, the actionmap is not recognized (i guess because it's considered a struct?) and ActionMapActions is not valid as a method, as in

var _controller = InputActions.JetPackGM;

_controller.Move.started += OnMove();

I aimed to invoke events as code snippets in the component or c# events so the script doesn't even have to be attached to a game object, because I think a state/command pattern is going to be useful for expanding character skillsets/customization.

I am using set callbacks, and not sure if i'm implementing the class correctly anyway, as my template is a mashup of an official tutorial package using the old system, and a half-built strategy-pattern with the new input system; i.e. one uses an instance of the playerinputactions class being constructed as a protected static then made public as an instance, (while also implementing hash id's which seem like something i'd like, i want to pack functionality and optimization because I'm concerned the physics could get expensive) and the other uses a single action map. But I have a different map for civilian mode, gliding/fighting, and piloting vehicles.

Then there are hash id's, binding groups, scheme, interfaces, overloads, within this autogen class.

Also, apparently between 0.9 and 1.0 the autogenerated input actions class format has changed enough that I can't call IA. without calling .Action, (which I want to avoid because I already wrote a half dozen controls. I had this script working twice!! And then decided to update or fix a flag.) The first is considered a class, the second a struct, or considered a method, thus the former is flagged as empty and the second is not allowed.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by InfernalMajesty89 · Nov 06, 2020 at 09:39 PM

I have a soft solution, declaring variable before methods and then instantiating in Awake function. In time i'll learn more code principles and discover a more elegant, flexible, stable solution. https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputActionMap.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

139 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

State machine callbacks not being called on mobile iOS? 1 Answer

'SerialDataReceivedEventHandler' is not working. 3 Answers

Callback never gets executed 0 Answers

Clear event System.Action list 1 Answer

Calling C# methods from jslib 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges