Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Confetti or <e> support for RectTransform UI text

A topic by nsfwclubgames created Dec 25, 2020 Views: 154 Replies: 5
Viewing posts 1 to 5
(1 edit)

I looked at the StageScene/TextMeshExample. The <e=confetti> really excited me. It worked on the demo scene but I realized that the text was 3D as it was using a Transform. My text has to be in a RectTransform and thus the coordinates are not compatible, when I tried the STMEventIntercepter on a RectTransform the confetti spawned in at these coordinates

How can I get the Particle to display properly?


```

if(s.Contains("printpos")){
//Debug.Log(rawPos); //print the position of this letter.
Debug.Log(info.rawIndex.ToString() + " " + info.readTime.ToString() + " " + s); //print raw integer of letter
Debug.DrawLine(rawPos, rawPos+Vector3.down, Color.red, 10.0f, false); //draw a line from the corner of this letter, down
}

```

Developer

Hey!

That script is just an example for how a custom event script could be used to spawn an object at a character's location. If you make a new confetti prefab that uses a rect transform instead of a transform it might work? That said, particles aren't really meant to be displayed on Unity UI so some additional work might have to be done in that regard, too. If you have further trouble, I could try to write a script for you that spawns a gameObject at the right location after the holidays.

Yes i see that UI coordinates are not the same as world coordinates, Yes i would like to see this functionality added please. Thank you

Developer

Here, this should work! https://pastebin.com/F62NwH3H

Thank you very much it works