Quantcast
Channel: Answers by "Hullu"
Browsing index pages (40 articles)

Answer by Hullu

This is my solution: First setup playgames configuration like this PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .RequestIdToken() .Build();...

View Article


Answer by Hullu

Try something like this yield return StartCoroutine(EnemyContactTimer()); The **OrganiseChildren** should pause untill **EnemyContactTimer** is finished

View Article


Answer by Hullu

Try this //Replace this EndLevel(n); //With this StartCoroutine(EndLevel(n)); IEnumerator EndLevel(int n){ yield return new WaitForSeconds(5); //stuff } For accessing score etc... I would suggest...

View Article

Answer by Hullu

http://docs.unity3d.com/Manual/MobileOptimizationPracticalGuide.html

View Article

Answer by Hullu

You need to add **Rigidbody** to the trigger. You also might want to check **IsKinematic**

View Article


Answer by Hullu

Have you tried having it like this: IEnumerator Die(){ yield return new WaitForSeconds(transform.animation["Death"].length); if( GetComponent().instantiationId == 0 ){ Destroy(gameObject); //etc...

View Article

Answer by Hullu

I think the scripting reference explains it perfectly http://docs.unity3d.com/ScriptReference/Physics.Raycast.html For example this casts ray from your camera to mouse position when you click left...

View Article

Answer by Hullu

Here is a tutorial: https://www.youtube.com/watch?v=7Wj7rGiX_5Y

View Article


Answer by Hullu

In animation component, uncheck "Play Automatically". function LoadNextLevel (level_to_load : int) { animation.Play(animation.clip.name); yield WaitForSeconds (animation.clip.length);...

View Article


Answer by Hullu

You could do it this way: public GameObject[] buildings; void Start() { buildings = GameObject.FindGameObjectsWithTag("building"); } and then get the current amount of "buildings" with this:...

View Article

Answer by Hullu

I don't know much about RainAI or smoothpath, but i have used http://arongranberg.com/astar/ Here is tutorial for how to use astar, and (lucky you) on tower defence game:...

View Article

Answer by Hullu

Use "for" loop: Replace this: if (amount < burstAmount) { //Shoot amount++; ShotgunBullets(); } With: for(var i = 0; i < burstAmount; i++) { //Shoot } **edited**

View Article

Answer by Hullu

Something like this should work, haven't tested: void OnGUI () { if(!networkView.isMine) { Vector3 screenPos = Camera.main.WorldToScreenPoint(transform.position); screenPos.y = Screen.height -...

View Article


Answer by Hullu

Maybe because minutes is *float**? Haven't tested this tho: var guiTime = Time.time - startTime; var minutes : int = guiTime / 60; var seconds : int = guiTime % 60; textTime = String.Format...

View Article

Answer by Hullu

http://docs.unity3d.com/ScriptReference/LineRenderer.SetPosition.html lineRenderer.SetPosition(0, transform.position) lineRenderer.SetPosition(1, target.position) this renders line from index 0...

View Article


Answer by Hullu

Use **capsule collider**. Adjust the center, height and radius to make sure the collider is not "inside" the terrain.

View Article

Answer by Hullu

With this you can find all colliders around the object: http://docs.unity3d.com/ScriptReference/Physics2D.BoxCastAll.html OR you can use circle shape...

View Article


Answer by Hullu

I'm not sure if i understood you correctly, but do you mean like football game? So when the player is facing the ball something happens. If im right, one way to do this is with...

View Article

Answer by Hullu

Im not sure what you are trying to do, but here is fix for your current code: **Change** > if(transform.rotation.z > 16) {>> transform.rotation.z = 16; } **To** >...

View Article

Answer by Hullu

Check bootcamp demo. It has GameQualitySettings.js

View Article
Browsing index pages (40 articles)


Latest Images