playcanvas / editor

Issue tracker for the PlayCanvas Editor
https://playcanvas.com/
160 stars 28 forks source link

Custom Engine Specification Not Working Correctly #1167

Closed sutobu000 closed 4 months ago

sutobu000 commented 4 months ago

When using the PlayCanvas custom engine feature, there is an issue where the latest engine is always selected, even when specifying a self-hosted engine or a localhost engine.

https://developer.playcanvas.com/user-manual/editor/launch-page/custom-engine/

Current situation:

When a custom engine URL is specified, the engine at that URL should be used.

We would greatly appreciate it if you could address this issue. Thank you for your consideration.

スクリーンショット 2024-06-25 12 24 12 スクリーンショット 2024-06-25 12 25 21
slimbuck commented 4 months ago

Hi @sutobu000,

I'm not sure if the docs make this clear, but you are only able to use engine served from https://code.playcanvas.com and http(s)://localhost. No other domains will work. This was added as a security measure.

Could this be the problem?

Thanks

sutobu000 commented 4 months ago

Oh, I see it can be used from https://localhost ! I've been using https://192.168... until now...

It seems this was the cause of the problem. I now understand that for local development environments, I need to use localhost instead of IP addresses like 192.168...

Thank you for the quick response!

sutobu000 commented 4 months ago

@slimbuck, I had one more question,

When I want to check the content on a head-mounted display, I don't think I can run it with localhost. Is there any good workaround for this? I really need to use a slightly modified version of the engine for debugging.

slimbuck commented 4 months ago

Is this because you need https? Could you serve from https://localhost.

sutobu000 commented 4 months ago

Yes, HTTPS is necessary. However, that's not the issue here.

I think we need to use an IP address to access the local server on the PC from a smartphone or head-mounted display. Probably, the way to access localhost from a smartphone or head-mounted display would be to use the 192.168... IP address, so is there any other way to handle this?

Maksims commented 4 months ago

For testing on device, upload compiled engine as JS file in assets, and select "load after engine" for it. So Launcher will use that engine, and no query params required.

sutobu000 commented 4 months ago

Wow, I had no idea we could replace the engine like that! This is completely new information to me...

This is incredibly helpful! Thank you so much!

I'm really excited to try this method out. It seems like it will make testing custom engines on devices so much easier and more efficient.

Again, I really appreciate you sharing this knowledge. It's going to be a game-changer for our development process!

Thanks! @Maksims @slimbuck