- Home /
Unity WebGL build not rotating Transform.Rotation in WebPlayer
Good Afternoon Gentlemen, I was wondering If I can get any answers from you guys knowing so much more then me. I'm currently using a web-socket script to connect to my server & to cause a rotation on a gameObject. It successfully rotates with no problem when I go into game mode in Unity3D, Also When I build it to .Exe it works perfectly.
But when when I actually build to WebGL, it connects but never seems to rotate. No Idea why it works in .Exe and in Unity but not in the WebPlayer. My server says theirs a connection but I can't seem to figure out why transform.rotation doesnt work on WebGL. Any Ideas? Thanks.
Here is what I'm using.
var rotationVector = transform.rotation.eulerAngles;
rotationVector.y = float.Parse(reply);
transform.rotation = Quaternion.Euler(rotationVector);
I'm currently using a package from the asset store, "Simple Web Sockets for Unity WebGL". https://www.assetstore.unity3d.com/en/#!/content/38367
Answer by Bunny83 · Oct 24, 2017 at 03:26 AM
It's most likely a problem with your websocket. Are you sure you use an actual compatible websocket implementation? A websocket emulation that uses ,NET sockets under the hood won't work.
What websocket implementation do you use?
edit
Have you actually set Application.runInBackground
to true or set it in the player settings?
Yup, my loop that contains my sockets wouldn't run and give a return signal to my server if it wasn't. Like I said, it works on .exe builds and in unity its just when I run in WebGL player. I needed to build in web player because that was my original plan.