Quantcast
Channel: Answers by "Vandarthul"
Browsing latest articles
Browse All 86 View Live

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

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


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

Answer by Vandarthul

private var stopWaypointLoop: boolean; function Start () { functionState = 0; stopWaypointLoo = false; } function Update () { if(stopWaypointLoop == false) { if (functionState == 0) { Accell (); } if...

View Article

Answer by Vandarthul

Check this: http://answers.unity3d.com/questions/31429/argumentexception-getvalue-can-only-be-called-from.html

View Article


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


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

Answer by Vandarthul

Check this: https://docs.unity3d.com/Documentation/Manual/NavmeshandPathfinding.html and check sublinks also.

View Article

Answer by Vandarthul

transform.eulerAngles = new Vector3(transform.eulerAngles.x, 0,transform.eulerAngles.z);

View Article

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

There are a lot of tools that can reduce vertices of meshes, here are some: - [FREE/PAID]http://www.mesh-online.net/ : It has a free editor tool where it uploads your mesh to their online webservice...

View Article



Answer by Vandarthul

![An image that shows how to enable lightmap parameters on the objects][1] Make sure that you have the following settings enabled: 1. Mixed Lighting or Realtime Lighting enabled in Lighting tab. 2. The...

View Article
Browsing latest articles
Browse All 86 View Live


Latest Images