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 anwserman · Apr 07, 2012 at 11:07 AM · movementtransformcharacterjoystickeuler

Basic Character Transform with Joystick

I'm looking at some sample scripts within Unity, and modified a couple of them to be used to my liking. However, I'm having one issue with the controls on some of them. For instance, in the PlayerRelativeControl script (for Mobile devices), I can instantly change the direction my player is facing my quickly moving my thumb back and forth between the joystick's min-max axis.

This is not how I would like my player to run!

Ideally, if the player is moving the joystick left, the character would turn that direction, speed dependent on the degree the joystick is being held left. Same for being held right. Holding the joystick up moves the character, and holding it back does nothing (cannot run backwards). I've always programmed my character controllers by using Euler angles, so I would do

 yRotate = yRotate - degreeTurn

to change the player's direction. However, I do not see anything like this in the PlayerControl script. Could someone enlighten me on how I could achieve this? Instead of having movement like it is in the Penelope demo, I'd rather have movement that's more similar to an actual running person. Or Mario 64 ;)

For an idea on how the axis values work:

X-Axis:
-1 (Fast Turn Left)
-.5 (Med Turn Left)
0 (No Turn)
.5 (Med Turn Right)
1 (Fast Turn Right)

Y-Axis:
1 (Run forward fast)
.5 (Walk forward normal)
<=0 (No movement/stand still)

I would just like ideas on how to accomplish this, or a hint. I cannot learn anything if fully coded solutions are just thrown at me! Thank you much! =)

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 0tacun · Jan 23, 2014 at 10:56 PM

Pretty old question.

If there is still a need, check this out

http://www.youtube.com/watch?v=zy9E-w4QM2o

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Rotatating a character 2 Answers

Android joystick & character movement script 0 Answers

How Can I Rotate My 2D Top-Down Character Rotation With Mobile Joystick? 0 Answers

simple movement help 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