Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to run Unity WebGL on Wordpress?

Discussion in 'Web' started by cankirici34, Nov 19, 2022.

  1. cankirici34

    cankirici34

    Joined:
    Mar 27, 2020
    Posts:
    16
    hello, I want to run webgl in wordpress. I did some research, I think it used to be done with iframes, but now I guess wordpress doesn't support iframes. but even if it supports i don't want to use iframe. I want to run unity build on wordpress. first i uploaded a build to aws s3 server but then i didn't know how to call that link in wordpress. then there is a plugin called file manager in wordpress as if it works like a server i guess i don't quite understand if i put the files there, i think maybe i can make it work but i need to buy a plan for that i wanted to know if it is possible before i do that, can anyone help me if anyone knows about it? Or is there a better way? The main purpose is to run the game on wordpress. I want the wordpress site to communicate with unity by sending a message from unity to javascript.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,467
    Do you need to send that parameter only on startup and it doesn't matter if the WebGL site is a static html page? If so, you could link to an URL to a static page where your content is hosted, and the URL encodes the parameters. May need some PHP scripting though to pass URL parameters to the WebGL build.

    Perhaps a plugin like this one best suits your needs: https://wordpress.org/plugins/howescape-unity3d-webgl/
    Or this asset: https://assetstore.unity.com/packag...n-2020-1-3-75091?aid=1011l3q6a&utm_source=aff
     
  3. cankirici34

    cankirici34

    Joined:
    Mar 27, 2020
    Posts:
    16
    Actually, I'm not entirely sure about the things you mentioned about whether the page should be static or not, but I can say that I want to run Unity inside the website, that is, in the middle of an e-commerce site, I want to see and edit the products with 3d models. this is actually my only problem and after editing that product, I want to add it to the wordpress cart, I think I need communication for this
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,467
    Best to use an IFrame then. For communication with Wordpress you could set up a REST API, perhaps the shop software itself already provides means to do that. You can use UnityWebRequest API in the WebGL build to do the communication.
     
    cankirici34 likes this.
  5. cankirici34

    cankirici34

    Joined:
    Mar 27, 2020
    Posts:
    16
    hmm got it i guess it would be better to do it that way yeah Thank you