Quantcast
Channel: Answers by "Vandarthul"
Browsing all 86 articles
Browse latest View live
↧

Answer by Vandarthul

public AudioClip[] SoundEffect; private AudioClip randomlySelectedAudio; // Add this line. void Update () { if (Input.GetButtonDown ("Fire1")){ randomlySelectedAudio = SoundEffect[Random.Range(0,...

View Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article


Answer 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 Article

Answer by Vandarthul

Just set first option to be "Select Country" and check that.

View Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer by Vandarthul

Edit - Preferences - External Tools - External Script Editor: MonoDevelop(built-in)

View Article

Answer 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
Browsing all 86 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>