- Home /
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:
You can see the GUIText on top of the 3dText
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.
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.
Your answer
Follow this Question
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