Answers is deprecated.

Please use Forum to participate in community by asking and answering questions!


I'm wondering if PlayCanvas have something to draw simple lines or circles. I want to use it for debugging purposes. I'm just looking for something similar to Unity's API -> Debug.DrawLine or similar.

If Playcanvas doesn't have this feature, I would appreciate if somebody could propose a similar approach.

Thanks in advance!

asked 28 Dec '16, 22:50

sortegam's gravatar image

accept rate: 0%

edited 28 Dec '16, 23:01

You need the pc.Application#renderLine function.


answered 29 Dec '16, 12:49

will's gravatar image

will ♦♦
accept rate: 46%

Great! And for circles? I did not found anything like this in the Docs.

(29 Dec '16, 13:01) sortegam

For that, you just need Math.sin and Math.cos and the renderLine function if you want to do circle outlines. If you want to render filled circles, you could use a plane with an alpha texture. Or you could model a circle in a 3D app like Blender/Max/Maya and import as FBX. Or you could procedurally create a pc.Mesh with the pc.createMesh function:

(29 Dec '16, 13:05) will ♦♦

Thanks a lot for the explanation!

(29 Dec '16, 23:10) sortegam
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28 Dec '16, 22:50

Seen: 1,036 times

Last updated: 29 Dec '16, 23:10

about | privacy | support | contact