Skip to content

Scale PathCreator game object according to screen size. #139

@Ankit-Gamit

Description

@Ankit-Gamit

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions