Hi all, How does one program something like this: http://www.google.com/imgres?imgurl...ge=1&ndsp=37&ved=1t:429,r:23,s:0&tx=175&ty=49 Do you see how the characters have green lines under them that "follow" the terrain? Do I need to do low-level things with GL? Any tips will be nice! Thanks!
You can use LineRenderer depending on what exactly you want... I used it a while back for this purpose. Code (csharp): selectionBox = new GameObject(); selectionBox.transform.parent = transform; lineRenderer= selectionBox.AddComponent<LineRenderer>(); lineRenderer.SetVertexCount (70); lineRenderer.useWorldSpace = false; int index = 0; for (float i = 0f; i < Mathf.PI * 2f; i = i + (Mathf.PI * 2f) / 60f) { lineRenderer.SetPosition (index++, new Vector3 (transform.position.x + radius * Mathf.Sin (i),transform.position.y + radius * Mathf.Cos (i), 0f)); } lineRenderer.SetPosition (index++, new Vector3 (transform.position.x + radius * Mathf.Sin (0f),transform.position.y + radius * Mathf.Cos (0f), 0f)); selectionBoxRenderer.SetVertexCount (index); you need to recalculate the points every frame if you want it to follow tghe terrain
Could you do some kind of texture projection or maybe a decal? I do not know how to do it, but maybe somebody else does. I think you need unity pro though to use decals.
Use a projector placed as a child of the character, facing down. Set it to ignore all layers except the terrain, and it'll project the circle texture down on the ground. It won't be off the ground, or 3D, for that matter, but it's the simplest method of doing that effect I think. Cheers