Posts

Showing posts with the label Unity

how do I access variable or call a function from other script in unity

Image
 Accessing and modifying variable and calling from other script is quit simple. So in this post we access variable from other script and modify and call it. so lets get started.  Lets create an empty scene in your project. In this scene create two empty game object and named them "variable and function script" and "test  script". Now create two scripts one in which we declare variable and function named as "variable_function" and second by which we access these variable and call function named as "test".  Drag and drop variable_function script in "variable and function script" gameObject and test script in "test script" gameObject. You can use any name of gameObject and script these names are just for reference so you can understand which gameObject and scripts I am talking about. variable_function script using   System . Collections ; using   System . Collections . Generic ; using   UnityEngine ; public   class   variable_fun...

how to pause game by script in unity ( with android back button or with computer esc key )

Image
In this post we will create a simple ui button to pause game and show paused UI and other button to resume game so let's get started. Create a Button UI gameObject and named as pause button. (you can name whatever you want).change its text component to pause. if you want to show a (  ||    )  icon to pause game then delete text child object of pause button and then drag your icon in source image of Image component in inspection window. Then create a Panel UI GameObject named as pause menu UI and create a child text ui gameObject (write paused it it text value and place it at top of pause menu panel) and one child button UI gameObject placed in the middle of pause menu panel and named as resume(Change button to resume). Make sure both text and button are child of pause menu UI. this is a simplest UI. You can design your own according to your need. You can add many UI buttons , UI Image, and text in pause menu ui panel and design in your own way like replay, get free ...

Difference between unity personal and unity plus/pro/enterprise

 Unity is a great tool to create games for different platform with single code. Unity have paid and free version. Unity personal If you are a hobbyist or have low financial condition then unity personal is for you. It is completely free for creating games and you can earn money with it but it have only one condition that your organization (you) should not have earned more then $100k in last 12 months which is quit high.  Features of unity personal Core unity engine for game development all editor versions including beta versions. all platform build support. Bolt visual scripting You can use unity ads and unity in app purchase in your game limitation of unity personal organization revenue should not greater then $100k in last 12 months (including funding and other sources) Unity branding in splash screen. Don't have source code access. Unity subscriptions If your revenue or funding greater then $100k  in last 12 months then you have purchase a subscription. Unity offer thr...

Mac vs Windows pc for Unity game devlopment

 Unity is great tool for creating 3d and 2d games. If you are thinking which pc you should use for unity so you can use any OS because unity is a program which have properties and functionalities to run. Unity is a quit heavy software so you choose a high performance cpu, and 8 GB or more RAM. Unity work smoothly in both OS mac and windows. All features are same. When you are creating a game, game will only depend on scripting, UI and other unity tools rather then on which OS running unity. Both OS have same core engine and C# scripting. OS only matter for what platform you are creating games MacOS importance Mac is only important If you want to publish your game to Apple App Store then you must have a mac for uploading your game to their store. You can not publish your game to Apple App store if you don't have a mac. In all other cases both OS are amazing. MacOS vs Windows Mac have a little better performance than windows. So if have a same hardware type windows and mac pc in that...