Is there a way to create line on playcanvas's screen

I want to connect 2 image elements with a line , considering position of 2 images can be anywhere on the screen

Hello @Ashish_Rana1 ,

I suggest you take a look at this method in our docs. It allows you to draw a line between to objects, by specifying their coordinates in 3D space. Let me know if this doesn’t meet your needs.

a simple example is here PlayCanvas Examples

With the image elements, you can get the canvas position of the corners to help work out where line start and end points are: https://developer.playcanvas.com/api/pc.ElementComponent.html#canvasCorners

Alternatively, you can try to use an image element for the line and position it via the global/world position using the information here: Dropdown For Different Aspect Ratios - #4 by yaustar

It’s going to be a little tricky no matter which method you use though