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 /
  • Help Room /
avatar image
0
Question by Zedream · Apr 01, 2016 at 01:28 AM · input.getaxisverticalhorizontalarrow-keys

Left Right Inputs not working

Hi, i'm having a problem : i used the Import package => Character => ThridPersonCharacter but going forward and backward wasn't working. Then i tried to make my own script :

"using UnityEngine; using System.Collections;

public class Thirdpersoncontroler : MonoBehaviour {

 float moveHorizontal;
 float moveVertical;

 float moveSpeed = 10;
 float rotationSpeed = 80;
 void Update() {
     moveHorizontal = Input.GetAxis("Horizontal");
     moveHorizontal = Input.GetAxis("Vertical");

     transform.Translate(Vector3.forward*moveVertical*Time.deltaTime*moveSpeed);
     transform.Rotate(Vector3.up*moveHorizontal*Time.deltaTime*rotationSpeed);

 }

}" But the problem remains. When I delete the line " transform.Translate(Vector3.forward*moveVertical*Time.deltaTime*moveSpeed);" I can still move my cube with the Up and Down arrows. It's not a Kinematic problem since Rigidbody isn't activated.

I also checked in Edit => Project Settings => Input if something was wrong but everything is set up correctly. I reseted it, values and checking didn't change.

I think it may be a Register problem but i don't know how it works. I'm on Unity 5.3.4f1 Personal running on Windows 10, everything updated, Asus G75VX gaming laptop.

Some guys seem to have the same problem but i couldn't find the answer. Thanks

Comment
Add comment · Show 2
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 Fredex8 · Apr 01, 2016 at 07:15 AM 0
Share

This is why I prefer to have manual, specific input conditions rather than using shortcuts like Horizontal and Vertical.

As far as I am aware they listen for all mouse, keyboard, joystick, controller etc inputs dubbed horizontal and vertical ie: the arrow keys too. The documentation isn't actually especially clear (as usual) but the second example there is written just for mouse Y and X.

avatar image Ali-hatem · Apr 01, 2016 at 08:57 AM 0
Share

you might have another script attached to the object & in your script above you have assigned moveHorizontal to both Input.GetAxis("Horizontal"); & Input.GetAxis("Vertical"); & also i am nut understanding what are you trying to do Vector3.forward is used to send object to specific position if you want just to move object by input we should do something else so tell us exactly what you want.

0 Replies

· Add your reply
  • Sort: 

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

55 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

Related Questions

Horizontal/Vertical Layout Group forcing control? 0 Answers

Bug: Unity InputManager sets Horizontal/Vertical input value on Window Focus 0 Answers

How Would i add animation to this script for vertical and horizontal movement :/ im very new to this and i have no clue 0 Answers

Trying to get script to receive input from EventSystem 1 Answer

Multiple Scroll Not Working 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