Post by Prezence on Aug 29, 2016 7:05:41 GMT 10
Alright, so I'm trying to paint lines on the ground in Unity (like a soccer or baseball field). How would I go about doing this? I'm working on a pretty cool game I might release at some point
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by altair on Aug 30, 2016 20:31:07 GMT 10
EDIT : I see that you are making a baseball/soccer field... Then if you are in 2D, you have to make a texture of the field... If you are 3D, you have to make a 3D model of it...
Okay... Can you explain it a bit more... What are you trying to achieve, whether it is 2D or 3D (won't matter much)....
(I was blind)
Possible Answers : If you want to draw lines in Unity, you should a LineRenderer component... (just search it up in the Add Component box in the game object from which you want to render lines from... I think it is 2D thing though...
Another way is to mess with OpenGL rendering code (Unity converts OpenGL instructions to DirectX, so don't worry about it)
The other way is to make an image of a certain color (the color you want the line to be), Add it to the scene and render it using a SpriteRenderer and scale it accordingly... (If this is a 2D scene) In a 3D scene, add the texture to a material, attach the material to a cube and resize it accordingly.
If you are debugging, you can use Debug.DrawLine to draw a line in the Scene Editor when ran on Editor (Pressing the Play Button)...
Unity would a bit confusing when you begin (especially people who are from typing everything in situation). But it is one of the quickest ways around to make awesome games without worrying a lot about the stuff underneath..
If you want I will put up a tutorial here to help you guys out....
Have fun!!!
Last Edit: Aug 30, 2016 20:42:48 GMT 10 by altair: I was blind
|
|
Post by Prezence on Aug 31, 2016 21:58:07 GMT 10
Line renderer would have worked for like one line, but I needed multiple with multiple colors, so I abandoned that idea. As of now, I'm trying to make a sketchup model of the field. We'll see!
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by altair on Aug 31, 2016 22:01:02 GMT 10
Golden rule of Game Development... If something does not change.. Make it a texture.. (or model in this case)
|
|