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 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 ArticleAnswer by Vandarthul
Lets just assume that your game's scene's name is *level1* and gameover scene's name is *gameOver*. First of all you will have to change your code to display GameOver screen as...
View ArticleAnswer by Vandarthul
I believe the problem is GetComponent returns a Type therefore it needs to be assigned to a variable. SpriteRenderer weapGunRenderer = weapGun.GetComponent(); weapGunRenderer.enabled = true;...
View ArticleAnswer by Vandarthul
private var stopWaypointLoop: boolean; function Start () { functionState = 0; stopWaypointLoo = false; } function Update () { if(stopWaypointLoop == false) { if (functionState == 0) { Accell (); } if...
View ArticleAnswer by Vandarthul
Check this: http://answers.unity3d.com/questions/31429/argumentexception-getvalue-can-only-be-called-from.html
View ArticleAnswer by Vandarthul
Okay you have two options. I'll write and advice before writing options. Instead of controlling enemy count on every enemy object, **create an EnemyController.cs** script and **add an empty gameobject...
View ArticleAnswer by Vandarthul
You can use Physics.Linecast or Raycast to control if you are touching the ground or not. You can check the unity's 2D tutorial and get the idea of using Linecast. There is a script written in that...
View ArticleAnswer by Vandarthul
Check this: https://docs.unity3d.com/Documentation/Manual/NavmeshandPathfinding.html and check sublinks also.
View ArticleAnswer by Vandarthul
transform.eulerAngles = new Vector3(transform.eulerAngles.x, 0,transform.eulerAngles.z);
View ArticleAnswer 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 Article