Quantcast
Channel: Answers by "Paparakas"
Browsing all 27 articles
Browse latest View live

Answer by Paparakas

If you preffered to not use triggers , you could also do: void OnColliderHit(Collider other) { if(other.gameObject.tag == "Target") { Destroy(other.gameObject); } } If you wanted to make the projectile...

View Article



Answer by Paparakas

- First, go to the object that you want the ray to check if that's the object it hit - When you have that object selected, look in the inspector at the very top - Where it says tag, click on the...

View Article

Answer by Paparakas

Try doing `rigidbody.AddRelativeForce(Vector3.forward * speed * Time.deltaTime);` instead.

View Article

Answer by Paparakas

If the script that instantiates the grenade is attached to the player, you could something along the lines of: GameObject Grenade =...

View Article

Answer by Paparakas

You could use Time.time http://docs.unity3d.com/Documentation/ScriptReference/Time-time.html Let's say in your game, every second counts as a day. You could use Time.time to check how many seconds have...

View Article


Answer by Paparakas

Try doing float myTimer = 70; float TimeLeftInSeconds = 0; float Minutes = 0; float Seconds = 0; string message = string.Empty; function OnGUI(){ if(showGUI){ if(myTimer > 0){ TimeLeftInSeconds =...

View Article

Answer by Paparakas

You can use the static modifier. Instead of doing public void IncreaseScore(), you can do public static void IncreaseScore instead. You'd then be able to update the score from any class, without having...

View Article

Answer by Paparakas

Try using transform.Translate instead. eg. transform.Translate(Vector3.up * moveUp);

View Article


Answer by Paparakas

Changing the collision detection from continuous dynamic to discrete worked. Alternatively not rotating the object also made the problem go away. Explanation by @Dracorat as to the *why* of the...

View Article


Answer by Paparakas

Enable use root motion in the animation component.

View Article

Answer by Paparakas

transform.Rotate(Vector3.one * 4 * Time.deltaTime); Put that in your Update() function and it should work. You can change the "4" to any number to speed it up or slow it down. Or you can make a Speed...

View Article

Answer by Paparakas

Got it to work by doing crabScript.SpecialAbility = (CrabScript.SpecialAbilities)EditorGUILayout.EnumPopup("Special Ability",crabScript.SpecialAbility); I guess the cast had to be the class.enum...

View Article

Answer by Paparakas

As far as I know unity has no support for morphing. There's a plugin that you can buy but if you're not looking to spent any cash then bones are the way to go about it.

View Article


Answer by Paparakas

Ok so I actually know this one since I've had some frustrating moments with it in my own project. If the parent is a rigidbody and the children are all exclusively colliders, it will act as a compound...

View Article

Answer by Paparakas

- First, go to the object that you want the ray to check if that's the object it hit - When you have that object selected, look in the inspector at the very top - Where it says tag, click on the...

View Article


Answer by Paparakas

Try doing `rigidbody.AddRelativeForce(Vector3.forward * speed * Time.deltaTime);` instead.

View Article

Answer by Paparakas

If the script that instantiates the grenade is attached to the player, you could something along the lines of: GameObject Grenade =...

View Article


Answer by Paparakas

You could use Time.time http://docs.unity3d.com/Documentation/ScriptReference/Time-time.html Let's say in your game, every second counts as a day. You could use Time.time to check how many seconds have...

View Article

Answer by Paparakas

Try doing float myTimer = 70; float TimeLeftInSeconds = 0; float Minutes = 0; float Seconds = 0; string message = string.Empty; function OnGUI(){ if(showGUI){ if(myTimer > 0){ TimeLeftInSeconds =...

View Article

Answer by Paparakas

You can use the static modifier. Instead of doing public void IncreaseScore(), you can do public static void IncreaseScore instead. You'd then be able to update the score from any class, without having...

View Article
Browsing all 27 articles
Browse latest View live




Latest Images