Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question How to run Unity WebGL on Wordpress?

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

  1. cankirici34

    cankirici34

    Joined:
    Mar 27, 2020
    Posts:
    14
    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:
    4,085
    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:
    14
    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:
    4,085
    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:
    14
    hmm got it i guess it would be better to do it that way yeah Thank you