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 podmaster · Jul 04, 2014 at 03:33 AM · 2d-platformerspritesguitext3dtext

2D Game - GUIText doesn't shake with the camera

Hi first of all this is my first question here. Im from Argentina so sorry if i miss any word :).

I'm making a 2D plataformer game, every time my player shoots an spell and it hits an enemy the camera shakes a little. If the spell is bigger the amount is higher.

I'm building a prototype to get the basics to work. Now im setting the UI and i find this problem, when the camera shakes the GUIText doesn't follow. I want to know if there is any way to achive this by parenting the GUIText to the camera or other gameobject. I dont want to mimic the effect making 2 separate functions one for the camera shake and other for the GUI because i use randoms and acceleration and i dont think it can match the movement of both.

I have tried to set the GUIText as a child of different objects in the scene but it didn't work. I have also seen that i can use 3dText but is it correct to do so? and i have some problems with the 3dText rendering.

EDIT: The Blue bar on top is a sprite animated it works as an UI or GUITexture but it doesn't have the camera shake problem because it uses other kind of positioning.

Here is a screenshot:

alt text

You can see the GUIText on top of the 3dText

Comment
Add comment · Show 1
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 epicman245 · Jul 04, 2014 at 04:12 AM 0
Share

Hmm, maybe you should make 2 different 'shaking' scripts, it may look better.

Also, I think the reason you don't see the shaking is because when you parented the Camera to the text, they both shook exactly the same time creating the illusion that the text did not shake. $$anonymous$$aking 2 different shaking scripts will fix the problem.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Eric5h5 · Jul 04, 2014 at 04:43 AM

GUIText is not rendered in world space; instead it uses viewport space on a separate GUI layer. You should use 3D text instead. Just use a larger font size and reduce the scale of the 3D text.

Comment
Add comment · Show 1 · 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 podmaster · Jul 04, 2014 at 06:05 AM 0
Share

I feel so Dumb , it works perfectly Thanks a lot.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

2D AI follow issues 0 Answers

Why sprites are consuming a lot of VRAM ? 0 Answers

What to put for pixel art PPU 1 Answer

How to make GUI text disappear after a few seconds? 1 Answer

2D Physics game using sprites 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