Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 godfreyidk · Apr 04, 2018 at 06:31 PM · worldspaceinput.getaxislocalspace

How are the Input axes "Horizontal" and "Vertical" mapped to the world axes?

Hello everyone,

Are the Input axes "Horizontal" and "Vertical" mapped to world x & z axes respectively or are they mapped to the screen's x & y axes. Say my character's front (forward vector) was pointing in the same direction as the world forward vector (positive z-axis), but the main camera is rotated slightly, such that its forward vector is not aligned with that of the world. How then would the axes (directions) from Input be mapped?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Eno-Khaon · Apr 04, 2018 at 07:37 PM

The short answer is that the axes can be mapped to anything you want.

Rather than trying to find the correlation between the world axes and input axes, you should be trying to create the correlation between the inputs and world yourself.

If you're making a game with a 3-Dimensional control scheme, such as a first-person game, then your input axes should be "Horizontal" and "Vertical" relative to your play perspective. Left and Right would strafe left and right, while Up and Down would move forward and backward (by typical, modern standards).

Furthermore, the camera's orientation would only matter if you specifically decide that it should. For example, if the character is facing forward while the camera matches, but is aimed slightly to the character's right, then it's purely at your discretion whether the forward Input will move relative to the character or the camera.

As another angle to look at this from, consider "Tank Controls" as a scheme: The character moves from a third-person perspective, yet the "Horizontal" control axis turns and "Vertical" axis runs forward and backward for the character. The direct alternative to this is when the "Vertical" axis will always move the character toward or away from the camera (and "Horizontal" will move left or right relative to the camera), automatically turning to face those directions based on the Input provided.

So, really, there's no simple answer to this because there is NO predetermined answer to this. There are typical conventions to reference for how a control scheme is generally devised for a type of game, but nothing is set in stone. Tastes change. Styles change. Impressions change. The more games are made, the more ways there become to play them, and the more interpretations there will be for input to correspond to gameplay.

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
avatar image
0

Answer by godfreyidk · Apr 05, 2018 at 04:13 PM

@Eno-Khaon

Thank you for that thorough answer. I'll ponder on it. Cheers

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

76 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

Related Questions

transform.position is giving me local space 1 Answer

Specific use of TransformDirection 0 Answers

About World space and Local space 4 Answers

WorldSpace movement? 1 Answer

Applying Constant Force to Object A using Object B's Vectors. 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