Skip to content

Unity 2021.1 build canvas grows indefinitely when using no height or width is provided #394

Open
@jeffreylanters

Description

@jeffreylanters

Please avoid duplicates

Language and Compiler

TypeScript's built-in Compiler

What environment are you using?

Local Development Server

When does your problem occur?

When the Unity App starts

What does your problem relate to?

The problem seems Unity related

React-Unity-WebGL Version

9.0.0

React Version

18.0.0

Unity Version

2021.1

What happened?

When no width and height are provided, the canvas grows indefinitely.

Reproducible test case

import React from "react";
import { Unity, useUnityContext } from "react-unity-webgl";

function App() {
  const { unityProvider } = useUnityContext({
    loaderUrl: "build/myunityapp.loader.js",
    dataUrl: "build/myunityapp.data",
    frameworkUrl: "build/myunityapp.framework.js",
    codeUrl: "build/myunityapp.wasm",
  });

  return (
    <Unity unityProvider={unityProvider} />
  );
}

Would you be interested in contributing a fix?

  • yes, I would like to contribute a fix

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions