Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale PathCreator game object according to screen size. #139

Open
Ankit-Gamit opened this issue May 20, 2023 · 0 comments
Open

Scale PathCreator game object according to screen size. #139

Ankit-Gamit opened this issue May 20, 2023 · 0 comments

Comments

@Ankit-Gamit
Copy link

Ankit-Gamit commented May 20, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant