SebLague / Path-Creator

Path creation asset for Unity game development
https://assetstore.unity.com/packages/tools/utilities/b-zier-path-creator-136082
MIT License
1.83k stars 319 forks source link

Scale PathCreator game object according to screen size. #139

Open Ankit-Gamit opened 1 year ago

Ankit-Gamit commented 1 year ago

I am using PathCreator v1.2 from asset store and Unity 2020.3.25f1.

I have created many paths in my game but I am facing issue in multiple resolutions. Other elements like image are resized as the resolution changes, but PathCreator doesn't resize

I already tried scaling it using screen width and height, but doesn't work as expected. Here's the code I am trying to use for scaling. var worldScreenHeight = Camera.main.orthographicSize * 2; var worldScreenWidth = worldScreenHeight * Screen.width / Screen.height;

paths[pathIndex].transform.localScale = Vector3.one * worldScreenWidth;

What should I do to make the paths fit the screen?