Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 FVergara · Apr 09, 2015 at 04:30 AM · c#databaseonlinephpsql

Is it possible to create GameObjects dinamically from a server?

Hello guys,

I wanted to create a game which is going to use a SQL db and some server-side scripting (such as php). It's nothing big and it's not an online game but it requires some online features. I would like to know just if it is possible. I just want to create dynamic gameObjects using values which are going to be stored on a DB for their respective transform position .x, .y and .z properties.

Comment
Add comment · Show 4
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 FVergara · Apr 11, 2015 at 04:07 AM 0
Share

I guess this is impossible to do?

avatar image AlwaysSunny · Apr 11, 2015 at 04:11 AM 1
Share

$$anonymous$$ore likely it's a topic nobody who saw your question was familiar with. It doesn't sound impossible, though I personally have no experience to say definitively. Have you conducted some research on the subject? The keywords are strong and ought to yield some fruitful results.

avatar image Hrungdak · Apr 11, 2015 at 05:39 AM 0
Share

The server can /and should) not create objects on the client. The client gets some values from the server DB (aka a position) and then creates objects.

avatar image FVergara · Apr 11, 2015 at 03:39 PM 0
Share

Thank you! I figured out this is not a common thing to do this way so maybe there is a different way to approach this. I have done some research, sending data through php to unity and viceversa but as plain text... I don't know how safe and efficient is that... not at all.

Thanks for your answer :)

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by fafase · Apr 11, 2015 at 03:59 PM

You would be better off creating a json file that you store on the server. Then you get it with WWW and start parsing the data.

 WWW www = new WWW(url + objectName);
 yield return www;
 // Should check if it worked here
 string json = www.text;
 JSONObject jsonObj = JSON.CreateJSON(json);
 JSONArray object = jsonObj.GetArray("objects");
 
 // then you continue parsing whatever data you need
 // Finally you turn the data into actual game object 

Comment
Add comment · 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

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

using SQL db instead of playerprefs (playerlocation) 0 Answers

Any good tutorials for using databases with unity? 0 Answers

How to integrate SQL database in game? 1 Answer

simple online storage for game? Any other way? 1 Answer

Get echo output from PHP script which is on an FTP server with C# 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