Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 FunFreighterGames · Oct 21, 2014 at 05:45 AM · inputcontrollerjoystickright

problems moving game object with the right joystick

Hi, I'm having a problem setting up my game project with controller support. I control a character's speed with the left joystick which works fine, but I control the character's orientation by having him move towards a target object that I want to move with the right joy stick. I attempt to move the target object with the following code, but it results with me only being able to move the target object horizontally by moving the joystick on the 5th axis, and not at all on the 4th axis. I tried switching the axis to button inputs on the keyboard and they work fine that way, which baffles me a bit.

Update: Alright, I'm noticing that it will only register input from the 4th axis, but it will only register input from the 4th axis if I move the stick from the 5th axis

using UnityEngine; using System.Collections;

public class Xbox_Cursor : MonoBehaviour { public Rigidbody xbox_clicker; public float mouse_sense;

 // Use this for initialization
 void Start () {

 }
 
 // Update is called once per frame
 void Update () {
         xbox_clicker.AddForce(transform.right * mouse_sense * Input.GetAxis("Horizontal_R"));

         xbox_clicker.AddForce(transform.forward * mouse_sense * Input.GetAxis("Vertical_R"));
 


} }

this is what my input manager looks like

alt text

forgive me, I have a feeling this is a dumb question, but I'm having trouble finding an answer.

screen shot 2014-10-21 at 12.45.31 am.png (39.8 kB)
Comment
Add comment · Show 4
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 Linus · Oct 21, 2014 at 06:01 AM 0
Share

$$anonymous$$ade sure mouse_sense is not 0? Would also do a Debug.Log test to check values of the two Input.GetAxis

avatar image FunFreighterGames · Oct 21, 2014 at 06:32 AM 0
Share

Yeah mouse_sense is set to 20. When I do a debug.log only Horizontal_R seems to be getting updated, but I have no idea why.

avatar image Linus · Oct 21, 2014 at 06:55 AM 0
Share
 void Update () {
 rigidbody.AddForce(transform.right * mouse_sense * Input.GetAxis("Horizontal_R"));

 rigidbody.AddForce(transform.forward * mouse_sense * Input.GetAxis("Vertical_R"));    
 }

Worked for me using same input settings as you. Any chance xbox_clicker could be set to another rigidbody than the one on the object?

Double check that there not two Vertical_R in the input settings. Disconnect and connect the controller. Try the controller on another game or somehow check that it works. Try another USB.

avatar image FunFreighterGames · Oct 21, 2014 at 01:50 PM 0
Share

thanks, there is only one vertical_R in the input settings and I double checked and the rigid body for xbox clicker is correct. The controller isn't broken as I get the same thing with several different ones. Could this have something to do with me being on a mac?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by FunFreighterGames · Oct 21, 2014 at 09:42 PM

Alright, I figured it out. So apparently the inputs for the xbox controllers for Mac is different for those on PC. I don't know why I didn't think of this hours ago, but here is a link to what the Mac inputs are http://answers.unity3d.com/storage/attachments/7661-unity_360controller_mac_layout.png. Tell your friends.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Getting Raw Joystick Input via Script 1 Answer

Gamepad input, axis OR button 0 Answers

Controlling MouseLook script with keys/joystick 1 Answer

Unity ignoring joysticks of specified number 0 Answers

First Person Controller Erratic 1 Answer


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