0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Unity] WebGLビルドしたゲームをローカルサーバー(http)で動作させる設定のメモ

Posted at

背景

WebGLでビルドしたものは原則としてhttpsに対応したサーバーでないと動作しない。

UnityがあればUnityが勝手にサーバーを立ててくれるので特段問題はないが
あまりITに強くない友人へファイルだけ渡して遊んでもらおうと思ったときに

ローカルにhttpsサーバーたてろというのはちょっと敷居が高い
(そもそもサーバーをたてろというのも酷ではあるが...)

というニッチな状況において以下の設定をすれば普通にhttpサーバーで動作したよというメモ

ビルドセッティング

Edit > Player Setting > Player

Other Settings の Allow downloads over HTTP* という項目をAlways allowedにする
Publishing Settings の Compression FormatDisabledにする

この設定でビルドするとhttpサーバー上で動作することを確認

ちなみにサーバーはNode.jsのhttp-serverを使っている。
ビルドしたフォルダでnpm http-server .とするだけで遊べる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?