- Home /
How to draw a filled rectangle through script
Im trying to make a A* pathfinder for a maze. Im doing this with nodes(each square in the maze is a node). Now for debugging reasons I want to give certain notes different colors.
I want to do something like.
forloop...
{
openset[i].drawrectangle(vector2 position);
}
Ill appreciate any help.
Why don't you just make a quad prefab and scale it to size. Have a couple of materials that have different colors and apply the material based on the color you need every case? Just an alternative that I think might save some time here.
Was thinking about that aswell yes. $$anonymous$$ight be the way to go since it only for debugging anyway. thx
Answer by Bunny83 · Apr 14, 2019 at 03:58 PM
Have a look at the OnDrawGizmos callback as well as the Gizmos class. If you're working in the X-y plane you could use Gizmos.DrawGUITexture. If you work on different axes it's probably simpler to just use Gizmos.DrawCube.
Your answer

Follow this Question
Related Questions
How to go about pathfinding based on custom placed nodes? 0 Answers
Help understanding pathfinding 0 Answers
Pathfinding help 1 Answer