Editor v2 Upgrade - this.app.renderLine is not a function

Using the controller.js script which was acquired from the VR demo I get the error at this line:
this.app.renderLine(this.vecA, this.vecB, this.color);

I cant see anything in the migration docs. Is there a new alternative to renderline?
Cheers

https://playcanvas.vercel.app/#/graphics/lines

renderLine was deprecated since 2021 Refactoring, fixes and improvements of the line rendering by mvaligursky · Pull Request #3019 · playcanvas/engine · GitHub

(you should have gotten warnings when using it in Engine V1)

Ah interesting, one of the tutorials has this API. That should have been updated (CC @mvaligursky )

1 Like

Okay thanks I will take a look. I got the code from the VR template. (controller.js)

The solution is to replace:
this.app.renderLine(this.vecA, this.vecB, this.color);
with
this.app.drawLine(this.vecA, this.vecB, this.color);

Cheers

we’ll be converting all tutorial projects to V2, not done yet.
@KPal for visibility

1 Like