- Home /
Drag and drop Word game
Hi, im using unity 4.3 and making a simple 2d game that have some sprites with words that you need drag and put in the right location in a text to complete the phrase.
Like this:
My problem is in the left side i have one sprite with one 3D Text, what i need is to create Box colliders 2D in the position of () when i initiate the prefab, there is any way to get the position of () in the 3D Text and create a Box collider ? i cant do this in the editor because the text changes depending on the current level, so will never be the same position.
This only works for GUI text, im using 3D Text that uses a Test $$anonymous$$esh, renderer.bounds could solve my problem but its hard to find the exact location since the text have line breaks.
Couldn't you just use a separate text mesh for the underscored part?
I will try that, but can i concatenate string from differents text mesh? like a underscored part in the middle of the text.
Answer by Nethekurse · Apr 14, 2014 at 12:49 PM
One solution that i found its get the String that contains the text, split by words and create a new 3D Text for each word with a 2d collider, and then align the words as a normal text, but i dont have any idea how i can implement this in C#.
Your answer
Follow this Question
Related Questions
Unity 2D: sprite's rigidbody weight/rotation 0 Answers
Unity 4.3, generate 2d mesh 2 Answers
How to get correct scale for CircleCollider2D radius? 4 Answers
Joint2D Tutorials 1 Answer
2D Physics and Jump-Through Platforms 2 Answers