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
1
Question by yasser96 · Jul 13, 2014 at 01:33 AM · guijoystickthird-person

How to use virtual Joystick.js (Mobile Assets) with the default ThirdPersonController?

My character has the default script ThirdPersonController.js. I want to create a joystick on my screen which would enable it to move on touch screen. Whenever I import a joystick, it doesn't allow me to control my character with it. How can I get the Input/Output of the joysticks? How can I maodify my ThirdPersonControlller sript to make the player move.? Please provide the whole code for both the Joystick.js and ThirdPersonCOntroller.js. Thanks in advance.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HolBol · Jul 13, 2014 at 01:36 AM

Took me a while to figure out too. Open your TPC script and add this:

 var moveJoystick : Joystick;
 
 var XInput : float;
 var YInput : float;

And in Awake () add this:

 XInput = moveJoystick.position.x;
     YInput = moveJoystick.position.y; 
 
     h = XInput;
     v = YInput;

Then in the editor simply drag and drop your SIngle Joystick object onto the inspector variable for the ThirdPersonController. Worked for me, anyway.

Comment
Add comment · Show 2 · 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 yasser96 · Jul 13, 2014 at 07:29 AM 0
Share

Assets/Standard Assets/Character Controllers/Sources/Scripts/ThirdPersonController.js(5,20): BCE0018: The name 'Joystick' does not denote a valid type ('not found').

This is the error I get when do as you said.

avatar image yasser96 · Jul 13, 2014 at 11:47 PM 0
Share

got that figured out. No error now. But the joystick doesn't work :(

avatar image
0

Answer by Victor-K · Oct 16, 2014 at 08:47 AM

alt text

Extremely easy and intuitive to use, Touch Controls Kit allows you to quickly and easily develop actions based on a touchscreen, buttonб joystick, touchpad dpad and tilt.

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 marito · Feb 22, 2015 at 08:16 AM

http://www.raywenderlich.com/25828/how-to-get-started-with-unity-part-33

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

gui rotational issues 0 Answers

Unity 4.5 - Can't find UI in the “Create” list 2 Answers

Access clicked button from the different function 1 Answer

Converting world coordinates to screen coordinates 1 Answer

Unity3d build project gui 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