Unity Dota style loading screen - c#

I'm creating a 3v3 multiplayer game and I'm stuck on an important part before the gameplay comes in.
I was wondering how you would approach creating a Dota 2 style loading screen for loading characters into the game (Picture below).
Creating the UI isn't the problem. The problem is animating it to look clean while also having it actually load the game (terrain/gameobjects/etc) with a progress bar or something.
I load the level with this
PhotonNetwork.LoadLevel('Game');
Then a gameobject spawns each player with
PhotonNetwork.Instantiate('....');
This works pretty well with nothing in the scene other than a plane to walk on. Now I just need to create the loading screen BEFORE the character loads while actually loading the terrain/objects/etc.
If anyone could point me in the right direction I would really appreciate it.
Thank you
Dota 2 style loading screen example:

I think this is a perfect case to use for Scriptable Objects in Unity.
Because as far as i remember there are around 100 heroes in Dota 2 and only 10 of them will be picked. So the images in this loading screen would change based on player input. Therefore, you should create scriptable objects. Then you can change the image(hero) also modify/add nick names to it in Run time. So to sum up you will have 10(in Dota but 6 is your case) scriptable object in your scene but you will only modify the images and nicknames after player selects the heroes.
Another benefit would be since they are objects you can easily animate them move up and down adjust however you want.
Here is a tutorial from Brackeys that is perfect for your case. Good luck!

Related

How to make dynamic shape adjustment to another shape

Hi guys i was wondering how to create a shape adjustment with two objects which specifically could be described as the independent cells, one of which is static, and the second one is dynamic and surrounded by "plasma". The movement of the active object must be controllable by the user (WSAD). Collision of the active object with the static one causes the static object to be swallen, though doesn't change it's position stays in place all the time. As the active object moves, passes the swallen object and troughts it out.
See the image below:
Player character
When it comes close enough to pink enemy it's starting to swallow it (surround by yellow thing)
Pink enemy is completely sourrounded when red circle is in the centre of both.
When it leaves enemy it takes off the yellow thing
I was wondering what is the simplest way to do it. I've been thinking about cloth, physics joints, mesh substraction (is it even possible?), some kind of animation... I don't have much time to do it. Can you show me the simplest way. Which tools and approach should i use? I'm not asking for full code or full solution only for some tips.
Tim Hunter mentioned a wonderful way, most perfect in 3D.
You can use another approach in 2D :
Inside OnCollisionEnter2D try finding hit points using Collision2D.contacts . See this reference .
Create some particle effect there.
Disable the enemy
Now play swallowing animation of the player.
At animation end, enable enemy again.
Maybe calculation is little tricky, still efficient.

Gaze Over, display Tooltip in Unity with GoogleVR

Does any know or can possibly point me to some instructions or a github repository on how I can create a script where I have an object and in GoogleVr (Cardboard) if I was to gaze over an object, a tooltip would appear?
If anyone is familiar, in the Cardboard Demos under Under Arctic Journey > Learn, when you click on the fox, a tooltip appears to showcase that item along with like a brief description on it. I want to have something similar (maybe even the same thing) except just having a gaze over will automatically show it. Is this possible?
I want to have this done on multiple objects in my project so I want it created so I can easily substitute out text and whatnot.
Have a script with a reference to a World Space Canvas (WSC). The WSC will be your tooltip and be activated when you hover over the object and disabled when you don't.
You can set images and texts of the WSC through the inspector or through code if you make a reference to them.
The script should also always have its rotation set to face the player.
You can use the SetActive(bool) method to show or hide the WSC.
The UI system makes it easy to create UI that is positioned in the world among other 2D or 3D objects in the Scene.
Start by creating a UI element (such as an Image) if you don’t already have one in your scene by using GameObject > UI > Image. This will also create a Canvas for you.
Set the Canvas to World Space
Select your Canvas and change the Render Mode to World Space.
Now your Canvas is already positioned in the World and can be seen by all cameras if they are pointed at it, but it is probably huge compared to other objects in your Scene. We’ll get back to that.
https://docs.unity3d.com/Manual/HOWTO-UIWorldSpace.html

How to make adjacent tiles combine seamlessly ?(2D)

Ok ill get straight to the point, here is an image of what i want to achieve:
And here is an Image of what my game looks like:
What I'm referring to is how the tiles seamlessly "connect". As you can see, on the first image there is a slight fade from one tile to the next one, for example where the sand and grass meet. On the second image, my game, there is not fade and no transition and it looks very bad. Like when the grass changes colors, there is no fade/filtering.
I assume this is a fairly common problem, so is there any assets from the asset store that solve this problem, or any built in solution within Unity? (Without writing own own custom script, of course) If there isnt any, how do I go about creating this filtering/transition between the tiles?
I suggest you to draw them on your own in some software and then importing it in Unity, other way to do it is to make them overlay where the transition is and put 50% opacity on both layers just where they are overlaping, this will give you small effect of transition.

Hide GameObjects to speed up game performance

My question is, how could I hide a GameObject when it is not being rendered by the camera, but to unhide it when it comes back into the camera view?
My code is the following:
void Update () {
if (renderer.isVisible) {
objectToHide.renderer.enabled = true;
}
else {
objectToHide.renderer.enabled = false;
}
}
The problem is, the object becomes hidden, so it can't be detected and unhidden.
Any help is appreciated!
(The goal is simply to speed up the FPS and improve game performance)
Your answer is simple. The game only renders the objects in camera sight. You can hide an object or even disable the renderer component but its not used for memory management or better process.
There are standard techniques for making a game run more effient. One of them is LOD or LEVEL OF DETAIL. You have a model with different polycounts and different texture resolution. When its near you use the highest polycound and highest texture resolution for further distance you use lower options.
Another technique is level streaming. If you have a big level and you want to game run on low memory or don't make players wait for long time for level loading, you have to do this. If you search a little you can find lots of information on different engines.
Most recent games have an option to choose foliage detail or environment detail. You can make a layer for every level of detail of your game and for every level of option player made you destroy those objects. Maybe I'm wrong but renderer.enable cant be good because the object still is in game and game just doesn't show it. You have to change many components to make it work and controlling all of them is hard.
To improve performance, you better try to destroy scripts and gameobjects as soon as they are not needed. Like bullets coming out of the game board, scripts that run just once and already finished, ...

Mesh Overlay from Scene view in Game

This is a bit of a difficult question to search because "mesh" actually means something in Unity, but anyway... I was wondering if there is a way to be able to incorporate the blue 'mesh' overlay effect on top of an object selected in the scene view, except in game. It doesn't look readily available, but I feel like if it's there in the scene view there should be some way to activate it in the game. I want to use it for a 'highlight' or hover-over feature for some objects.
I'm basically referring to what surrounds the capsule in this
http://i.imgur.com/RSwYbRE.png
You want something called a wireframe shader or wireframe renderer. There are some paid versions in the asset store as well as a couple of scripts that should help you achieve this look.
http://forum.unity3d.com/threads/wireframe-shader-the-amazing-wireframe-shader.251143/
http://answers.unity3d.com/questions/144693/wireframe-rendering.html
http://www.starscenesoftware.com/vectrosity.html

Categories