#Help, spawned cavas UI text not visible.

1 messages · Page 1 of 1 (latest)

hollow fjord
#

Hey guys, I have a situation where I manage to spawn a cavasUitext but when the game is running even if it spawns OR I drag the prefab to the scene it is invisible.

#

here not in play mode

paper quiver
hollow fjord
#

During p+lay mode?

paper quiver
#

Yeah

hollow fjord
#

actualçly now when I dragged it .. it appeared.. but the spawned ones are not visible

#

ok i know what is happening

#

it is spawning there

#

for some reason

#

and I said to spawn at player position

#

ops enemy

#

position

#
            Instantiate(aboveHeadDamage, new Vector3(transform.position.x, transform.position.y + 2, 0), Quaternion.identity);
paper quiver
#

One tip that may or may not help, all UI objects will use a RectTransform, and it has a anchoredPosition and anchoredPosition3D, you maybe want the latter, or you maybe want to use the world position of your Canvas + some offset, if the canvas is already positioned where you want, though that code snippet looks like your just spawning it at the position of whatever that script is attached to

hollow fjord
#

hmm ok thank you.. i will maybe try another aproach trying to do a research now on how can I do what I want migyht have another way that doesnt use UI

#

I think empty object with textmesh component just found something about it

#

might work

paper quiver
#

If you only need 3D text in the game world, there is I believe GameObject > 3D Object > Text - then you could use regular world space positioning on that since it doesnt rely on a Canvas

hollow fjord
#

yeah I am trying to use the textmeshpro, but its invisible in the screen too not sure why

paper quiver
hollow fjord
#

well if I click there

#

there is no font to choose

#

wierd..

#

something simple seems so hard

#

even if I click on the eye where it says 6 invisible

#

nothing happens

#

ok

#

now I did it

#

there was a hidden window behind unity

#

to import font assets

#

i clicked it now the text appear

#

all great

#

thank you for your time my friend

coarse flame
#

Nice. I was just trying to find where the font should be, but you figured it out too fast

#

Do you have choices? You should have Ariel and/or Liberation Sans

#

And there are a bunch on the asset store for free, or you can download any .ttf format font

hollow fjord
#

no i just have 1 choise

#

actually 23 but they look the same

#

that appeared

#

clicked on both

#

now i have like 7..8 options

coarse flame
#

Maybe they are still downloading? Should be pretty quick though. I dunno

hollow fjord
#

maybe..even tho its fine now i will try to make it spawn

#

as it shoudl lets see

hollow fjord
#

Working like a charm now.. thank u !