Answer by Vandarthul
public AudioClip[] SoundEffect; private AudioClip randomlySelectedAudio; // Add this line. void Update () { if (Input.GetButtonDown ("Fire1")){ randomlySelectedAudio = SoundEffect[Random.Range(0,...
View ArticleAnswer by Vandarthul
I'm not sure if this is the best solution or an optimal one but I would try to do this: 1. Create a class that holds Question text, A, B, C, D choices, the true answer 2. Create a list of that class...
View ArticleAnswer by Vandarthul
Of course you can. But if you noticed it in Gumball, the camera is always looking at one angle if the scene includes 2d objects. Unity can interact with 2d and 3d objects at same time, it's only a...
View ArticleAnswer by Vandarthul
As I understand your project setup is like this, roughly: ![alt text][1] ![alt text][2] [1]: /storage/temp/78234-capture2.png [2]: /storage/temp/78235-untitled2.jpg If you want to allocate a collection...
View ArticleAnswer by Vandarthul
Since you are in Editor, and IOS platform(setted in build settings) both of those codes will work. Try this: #if UNITY_EDITOR Debug.Log("editor"); #elif UNITY_IOS Debug.Log("iphone"); #endif Also check...
View ArticleAnswer by Vandarthul
Hey @Giusort , I can offer you a way to do it in Android but you will still need to find a way to do it in iOS. You can wrap it up in [Platform Dependent Compilation][1] like #if UNITY_ANDROID and use...
View ArticleAnswer by Vandarthul
Hey @ishafdo4 Try this: public void LaunchApp(string package, string storeLink = null) { bool fail = false; string bundleId = package; // your target bundle id AndroidJavaClass up = new...
View ArticleAnswer by Vandarthul
Hello, @Rangr I would recommend you to use [Photon Engine][1] over Unity Multiplayer. The main reason is when master client(client that created the room) leaves, the game will be terminated in Unity...
View ArticleAnswer by Vandarthul
Your OnTriggerEnter and OnTriggerExit callbacks don't control the Collider. Tag your Player as "Player" and do this modification : void OnTriggerEnter(Collider other) { if(other.CompareTag("Player")) {...
View ArticleAnswer by Vandarthul
shot is a GameObject, probably a public one, so you could assign it in the inspector on which gameobject you put this script on. You should put a prefab on shot variable so it can instantiate it from...
View ArticleAnswer by Vandarthul
First of all, welcome to the community and Unity. Now I'll try to explain this as much as I can. There are lots of ways to do that, but I think what you are asking is not about the situation you are...
View ArticleAnswer by Vandarthul
Good questions. - Virtual calls are always expensive than direct calls. And you should avoid having too much Update calls. It's better to have a manager class with one Update and call other classes'...
View ArticleAnswer by Vandarthul
Here is a simple script that does what you want by using both Lerp and SmoothDamp. using UnityEngine; public class SmoothDampTest : MonoBehaviour { private Transform myTransform; private Vector3...
View ArticleAnswer by Vandarthul
The code you've produced could only have two waypoints with reverse directions. I've prepared a simple kind-of-generic waypoint system which will help you produce your own. Create a two C# scripts...
View ArticleAnswer by Vandarthul
Hello, @Kirillian If you would like to create your own save/load system, it's a pretty much yes. But it should not confuse you that much, and it shouldn't be hard in this case. You just need to take...
View ArticleAnswer by Vandarthul
If I'm not wrong, you want to equalise y axis of your object to the y axis of your player. Then try using [Mathf.Lerp][1] to achieve that. [1]:...
View ArticleAnswer by Vandarthul
Try creating a gameobject array that holds every enemy in range. And check that array after you killed an enemy, if it's not 0 continue to attack, if it's 0 turn to waypoint.
View ArticleAnswer by Vandarthul
Edit - Preferences - External Tools - External Script Editor: MonoDevelop(built-in)
View ArticleAnswer by Vandarthul
declare a bool under your class and true it when the character is moving and add this code(you will have to false the bool when the character is stopped moving too): if(isOnMove) { move =...
View Article