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 moghes · Jan 15, 2013 at 08:29 PM · positionguitexturepixelinsettouchpads

FPS control mobile changing joystick(guiTexture/touchpad) position when FPS control is not at Origin!

![alt text][1]Hello everyone! I am facing this issue since a while and couldn't find any solution. I am using the fps from standard assets mobile, where by default it has 2 joysticks(left touchpad and right touchpad).. When I move the fps control(whole control/main prefab)while developing and not after running the game, in world space, the touchpads dissapear, in fact they change their places, and I run the game and don't see touchpads and ofcourse can't move the player. I tried to figure out how they move and realize that for example if I move the player 1 unit up, the touchpads become at the top of the screen, that means for every unit I move the fps control, the touchpads move at screen.width or screen.height accordingly.

However if I leave the player at (0,0,0) , the controls are in their accurate locations, and everthing going on perfectly. Also I tried moving the player slightly about 0.5 units and then ran the game, the touchpads are in the middle of the screen, but work perfectly.

For now I am obliged to start the scene with the player at 0,0,0 . But I need to start at an another position, and can't find a solution.

I also tried to reset the touchpad position dynamically, like this: rightTouchPadGUITexture.pixelInset.x = (fpsPlayer.transform.position.x)(-Screen.width); rightTouchPadGUITexture.pixelInset.y = (fpsPlayer.transform.position.y)(-Screen.height);

Although I must not have to do this, there must be a simpler solution..

where I get the touchpads by a dragged reference, but still no result.

Please check the pictures for clearer explanation. (Here I have a transparent png for left touchpad, you'll see the change on the right touchpad).

picture1.jpg (208.7 kB)
picture2.jpg (218.5 kB)
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
1

Answer by Loius · Jan 15, 2013 at 08:41 PM

You can't parent the objects to the player - that means they'll move around. You need them to be all on their own (or parented to the "main gui object").

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 moghes · Jan 15, 2013 at 08:56 PM 0
Share

But this is the FPS control that the standard assets support us with. The touchpads are children of the main control. Although your suggestion solves this. thanks

avatar image Loius · Jan 16, 2013 at 01:24 AM 0
Share

Well, since you're having issues with them moving around, I'd recommmend it. I haven't used that control myself, so I don't know if it always does that or if you've added something (or if you're supposed to add something).

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Changing GUITexture's position through code (relative to screen) 1 Answer

Relative GUI positioning and Pixel Inset/Offset conversion 2 Answers

Help|Positing GUITexture on Center (in the middle of he screen) 2 Answers

Inverting text color over a guiTexture-textMesh? - android 0 Answers

Moving a transform behaves odd 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