Dynamically instantiated prefabs are invisible - unity3d

Now I know that this is a common problem and there are so many mistakes that would lead to it, but I have searched and seen all the results and answers in unity forums and other websites, and I'm sure that I don't have any beginner-mistake that would lead to it.
My problem is -Like the title states- that I have a "platform" prefab and I have a script, attached to some game object in the scene, that instantiates a new platform every x seconds. Now, the scripts works and everything is fine, the platforms are instantiated and they are moving and functioning as they should, but I can't see anything from this!
I mean that I can see them in the scene view window, where everything is fine, but in the game view window nothing appears, though I can interact with the platforms, such as landing on them and so on...

check the z depth... your probably instantiating them behind your camera. a good way to check is to start the game, go to scene, and take it out of 2d, then click one of the platforms in the explorer, and check its z value

It is highly possible that they are shown "behind" your background. I was making an android app and my buttons were displayed behind the UI panel. Try to instantiate your platforms as child objects of your panel.

Related

Why can't I see my WebView Prefab in Unity game window?

I used 3D WebView in Unity development. I dragged a WebViewPrefab into my scene and clicked 'play'. From the console I knew that it had already loaded the webpage I wanted, but I could't see it in the game window.
I had looked around, but still nothing in the game window.
Could anyone please tell me what had happened?
I had a similar problem not long ago. I found that WebView doesn't seem to be like those GameObjects we commonly use in unity, it can only be viewed from one direction. This means that if you look at it from behind, you won't see anything. Therefore, you need to adjust your main camera angle.
Also, when you use WebViewPrefab.Instantiate to create your WebView Object, it defaults to a somewhat strange position and angle. I usually set its position manually, and after that, it's easier to find in the game window in play mode.

Floppy Disk icon Middle of my screen when game is running

I'm a beginner in unity and programming, I was following a video for making a Flappy Bird game. Everything works perfectly but when I run the game, I get a floppy disk icon middle of the screen and somehing called DontDestroyOnLoad starts working out of nowhere. I couldn't find or understand anything on google when I search for it. I'm posting the screenshots in case anybody wanna see it.
This icon and dontdestroyonload thing only appears when game is being run:
There's a little button in the type right of your scene and game view called "Gizmos", un-toggle that button, should fix your issue.
Also don't worry, Gizmos can only be seen in the Unity Editor for level editing and debugging purposes --> if you were to build the game, for instance on IOS, they would disappear.
(if this doesn't fix your issue, then I would just create a new scene and copy your gameobjects over one-by-one)
I see someone responded about the main part of a problem, but I'll clarify about dontdestroyonload
Don't destroy on load is collection of objects that won't be destroyed when new scene will be loaded, usually objects there come from running them through DontDestroyOnLoad method somewhere in a script, however I noticed that some time ago Unity creators started to put there some stuff related to built-in tools (like debug)

Unity: suddenly some gameobjects stopped beeing shown

I'm a Computer Science
Engineering student. I'm currently working on a Uni project using Unity to build a 2D game. Until this morning everything was fine, but suddenly after some work on a UI Manager Script in my menu scene (Scene 0) when I tried to play the game some gameobjects (apparently random) stopped to be visualized on Scene View and on Game View in the Level scene (Scene 1).
I can see all gameobjects fine on camera preview and they all are active in the hierarchy, even all colliders are working.
I tried to look on the web, but I can't find any solution or any similar case...
I don't really have any ideas, I'll be really glad if someone can help me. Thanks.
Check the Material variable on the Sprite Renderer component and make sure it's set to "Sprites-Default". In my case, the material for the hidden objects had somehow changed to "None" while I was working on a little postprocessing effect.
Edit: Here's how the material changed. Adding a SpriteGlow script from a package which works with postprocessing had first turned the objects' SpriteRenderer material from the original "Sprites-Default" to "Sprite/Outline". Upon removing the SpriteGlow script component from the object, the material became "None" rather than defaulting back to "Sprites-Default" and that was when I stopped seeing the objects even though they were present in the scene. This is most likely your problem too since you said every other thing like collision works and the objects are definitely present in the scene.

Add scene when build Unity project

When I build Unity project I saw that if I add current scene Unity or not the game still run fine.
So what is the purpose of add scene ?
If you have not added any scenes then unity will build with your current opened scene by default. The purpose of adding scene is to handle among multiple scenes like Main Menu, Store, Gameplay, Gameover etc. To get more than one scene, you have to add all the relevant scenes, otherwise unity will not recognise the scene when you want to switch to another scene.
As long as #Hamza Hasan answer is correct, I think that question author means something diffrent.
He asks why he should add scene if it works fine in Editor without this action.
So the answer is, if this scene is not first default one (and it is your case), you wont be able to load it programaticaly, as it wasnt included into build even if it works in Editor. It works in Editor couse it was loaded into memory opening the scene.

Unity: Third Person Collision with Animated Platforms

first time posting on stack and everything looks promising so far! I had a bit of a complicated question here so I'll do my best to provide exact details of what I'd like to get accomplished. I'm working with a third person controller in unity, so far everything is going great. I've dabbled with basic up and down platforms, a little glitchy but things work. Anytime my player runs through a mesh I make sure the mesh collider is working and a 'rigid-body' is attached set to Kinematic. Here's the kicker, in my game I have turning gears which the player can jump on. This is great except for the player doesn't turn with my gear, which would make sense according to my game-play. What would be the process for getting my character to interact with this animated mesh? I imagine some sort of script which my nooby mind cannot fathom at this point in my unity career. If anyone out there knows the solution to this, I would love to have any assistance, either way I'll plugging away at a solution. Thanks again!!
This is assuming that you're using the packages that ship with Unity3D, which it sounds like you are. After importing the Character Controllers package, you'll have a bunch of scripts in the Standard Assets\Character Controllers\Sources\Scripts folder, in the project hierarchy view. There's a script in there called CharacterMotor.js, attach that to the same GameObject you're running ThirdPersonController on.
Essentially this script adds more interactivity between the character and the scene. There's several methods inside this script that automatically move the character when in contact with a moving object (as long as it has a collision mesh) basically by inheriting the object's velocity.
If your gear/cog wheel has a proper collision mesh set up, adding this script to your character should be all that you require.