• 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 awsome129 · Mar 01, 2017 at 07:16 AM · terrainloadresources.loadgeneratorlevel load

Why won't my terrain load.

I made a script that gets the player's world settings from the world setttings menu, and then load s the settigns in the next scene when the player continues. The terrain won't spawn. Please Help!!

Script in world settings menu: using System.Collections; using System.Collections.Generic; using UnityEngine; public class WorldSettings : MonoBehaviour { public bool FlatTerrain = false; public bool SemiBumpyTerrain = false; %|133382897_3|% // Use this for initialization void Start() %|-1971751899_6|% %|1244436034_8|% // Update is called once per frame %|-657146416_10|% %|-890458070_11|% %|-251084513_12|% %|-562753640_13|% { FlatTerrain = true; Application.LoadLevel("level1"); %|-582002089_17|% public void SemiBumpy() %|-831506893_19|% SemiBumpyTerrain = true; Application.LoadLevel("level1"); } public void VeryBumpy() { %|-526449255_25|% Application.LoadLevel("level1"); %|686669248_27|% }

Script in level after world settings: using System.Collections; using System.Collections.Generic; using UnityEngine; public class LoadWorldManager : MonoBehaviour { %|131026995_28|% public GameObject SemiBumpyTerrain; %|1237642956_30|% %|-902328880_31|% private WorldSettings WorldSettingsScript; %|-273883866_33|% { %|-1035811350_35|% FlatTerrain = Resources.Load("Flat_Terrain") as GameObject; %|-1575055408_37|% %|-562377359_38|% WorldSettingsScript = GameObject.Find("WorldSettings").GetComponent<WorldSettings>(); %|1449107905_40|% // Use this for initialization %|-1750449121_42|% %|1783188651_43|% { Instantiate(FlatTerrain, WorldSpawnPos, transform.rotation); %|1936957349_46|% if (WorldSettingsScript.SemiBumpyTerrain) { %|-70310332_49|% %|-1273183901_50|% if (WorldSettingsScript.VeryBumpyTerrain) %|-1583253834_52|% Instantiate(VeryBumpyTerrain, WorldSpawnPos, transform.rotation); %|882424543_54|% %|376581494_55|% { %|1821030991_57|% } %|-1166234788_59|% { Instantiate(VeryBumpyTerrain, WorldSpawnPos, transform.rotation); } %|-1005049537_63|% %|-1308870501_65|% %|-2139788344_66|% %|1449002551_67|% }

THX!!!

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Saving a randomly generated Terrain 1 Answer

Mass terrain generation 1 Answer

Resources.Load problem 1 Answer

terrain generator (looking for a product) 2 Answers

Making A 2d game android 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges