Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by chronos1 · Jun 03, 2011 at 11:13 AM · webplayer

webpage with a webplayer

Hello,

i have unity project with only prefeb of a Cube, build as webplayer streaming.

i would like to put this webplayer in a web page using visual studio 2010, asp.net.

so i open a new asp.net project, open a new webform. i copy the code from the webplayer(the page unity built) to my webform.

now when i run this page it contains the webplayer.

i wanna add a button and a textbox, when the user click on the btn the textbox changes its text.

input type="text" name = "text1" value="hoello" id="123"/>

input type="button" name="button10"

value="yaron" onclick=Anyoutput() />

script type="text/javascript" language="javascript">

function SaySomethingToUnity() {

document.getElementById("123").value = "pls let it change me";
} script>

but when i put this on the page with a webplayer, nothing happens for some reason, as if javascript events are disabled. any ideas on whats the problem?

Best Regards

Ron

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by homeros · Jun 03, 2011 at 11:35 AM

You don't need an asp.net page to accomplish what you're trying to do, an .html page is enough if you're not gonna do something server side. Anyway your problem is that you're using

onclick=Anyoutput()

but your javasript function is named

SaySomethingToUnity()

Change either of them and it'll probably work, if there isn't any syntax mistake.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chronos1 · Jun 03, 2011 at 12:04 PM 0
Share

thanks for your help, as i stated above, its only the first step im trying to make inorder to communicate with unity. i want it in javascript so that i can access later the sendmessage method.

avatar image homeros · Jun 03, 2011 at 12:07 PM 0
Share

check this http://unity3d.com/support/documentation/$$anonymous$$anual/Unity%20Web%20Player%20and%20browser%20communication.html

it has all the examples for you

avatar image chronos1 · Jun 03, 2011 at 01:13 PM 0
Share

lol thats the part that im trying to implement but i cant get it to work.

avatar image
0

Answer by BerggreenDK · Jun 03, 2011 at 11:30 AM

not sure if this is Unity3D related or more a Visual Studio problem?

If you make a new Webform within VS2010, you get a FORM element in the HTML. Drag a button and a textfield onto your page and let VS2010 do the coding for that.

Then doubleclick the button in the editor and this will open up the script/event part behind the button.

Now you are ready to code C# in ASP.net


But is your problem that you want to build a HTML item that communicates with the Unity3D player or are you trying to build some kinda login to your Unity project?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chronos1 · Jun 03, 2011 at 12:02 PM 0
Share

yes yes i want to communicate with the unity 3d player.

i want my c# code to run some code within unity. so the above was only the first step. and it failed..... do u have any advice, links or anything that can help me to achive this?

Thanks Ron

avatar image BerggreenDK · Jun 04, 2011 at 10:46 AM 0
Share

Still not sure of what you are trying to do. Can you explain the idea ins$$anonymous$$d of the problem perhaps? is it webbrowser/HT$$anonymous$$L talks into Unityplayer or is it Unityplayer talking to webbrowser/HT$$anonymous$$L ?

What is the goal?

avatar image chronos1 · Jun 08, 2011 at 07:22 AM 0
Share

the page (asp.net) trying to call the webplayer

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Problem with mouse cursor disappearing in webplayer 0 Answers

admob in webplayer? 1 Answer

How to load lightmap in the webplayer 0 Answers

Chrome Web Store , Google Wallet InApp Payment (JWT ??) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges