Quantcast
Channel: Latest Questions by RedDevil
Viewing all articles
Browse latest Browse all 100

Instantiate a GameObject at a position specific to an element that was found in a text

$
0
0
Hello! I am currently trying to create a chat using Unity. I am trying to instantiate emoticons at the position that the emoticon symbol was found but I am having to luck as of yet. I am correctly identifying the emoticons but I cannot instantiate them at the position the emoticon symbols were found. Please help me! Thank you! foreach (string item in EmojiStringList) { if (usr.GetComponentInChildren().text.Contains(item)) { switch (item) { case "^_^": { usr.GetComponentInChildren().text.Replace(item, string.Empty); GameObject emo = Instantiate(emoji[0], position, Quaternion.identity) as GameObject; emo.transform.SetParent(usr.transform, false); break; } } } }

Viewing all articles
Browse latest Browse all 100


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>