Language

Handles.DrawLine from transform.forward in 2D

Working on a 2D implementation for a radius checker but wanted to visualize it in 2D, having some issues though. Switching the editor code fow.transform.up to fow.transform.forward gets the DrawWireArc on the Axis for 2D but I'm not able to figure out how to do this for the DrawLine Handle. Sebastian Lague has a great tutorial for this in 3D but getting it to work in 2d is proving more challenging than I anticipated. Field of view visualisation Any ideas?

1 Reply

Hi! Thanks for the neat question. Can you post what the results look like as of now (the unsuccessful ones)? I would have thought, as you likely did, that it would in fact be a simple transform transform (pun unintended) from 3D coordinates to 2D coordinates.

A picture, or a screenshot, would be very useful to get a handle of what all the vectors, transforms, and angles are located in your 2D game as of now, to figure out how to modify it.

I'm guessing that instead of a top-down view with the view angles to the left and right, we have a side-forward view with the view angles up and down.