Answer by Dreamblur
Your LateUpdate method isn't closed. The method is OnControllerColliderHit, not OnControllerHit. You have that if(dead) line floating there doing nothing. The last block of code does not belong to any...
View ArticleAnswer by Dreamblur
Play the sound in the same method that spawns the player. So assuming that there's an AudioSource attached to the game object where the respawn script is attached, just call: audio.Play(); right after...
View ArticleAnswer by Dreamblur
When you run this line: gameObject.SetActiveRecursively(false); you are deactivating your game object, which means this script, being attached to the game object that was deactivated, will stop running...
View ArticleAnswer by Dreamblur
if(whatever) { score += x; bonusCheck += x; if(bonusCheck >= scoreToGiveBonus) { // perform bonus function (bonusCheck / scoreToGiveBonus) times bonusCheck %= scoreToGiveBonus; } }
View ArticleAnswer by Dreamblur
Application.platform returns an enum-type value representing the platform the build is currently running on.
View ArticleAnswer by Dreamblur
While answering a forum post, I realized what the actual issue was. A static rigidbody would technically be sleeping, and since collision events with character controllers aren't detected by a sleeping...
View ArticleAnswer by Dreamblur
"active" is not a member of MonoBehaviour. Use "enabled". Change the type declaration of "wire" to your script's class.
View ArticleAnswer by Dreamblur
The error is telling you exactly what's wrong with your code. There is no overload for the method using those parameters. The method requires an AudioSource and a Vector3 as parameters (and an optional...
View ArticleAnswer by Dreamblur
[Sort][1] [Sort][2] [1]: http://msdn.microsoft.com/en-us/library/w56d4y5z.aspx [2]: http://msdn.microsoft.com/en-us/library/234b841s.aspx
View ArticleAnswer by Dreamblur
Once you attach an audio clip to a game object, you'll have access to the AudioSource members. With the game object which the audio clip is attached to currently selected, click on the fold-out option...
View ArticleAnswer by Dreamblur
Assuming that: Transform house; Transform plane; then either: house.rotation = plane.rotation; or: house.eulerAngles = plane.eulerAngles; should do exactly what you want.
View ArticleAnswer by Dreamblur
I haven't tested it in UnityScript yet, but it shouldn't be possible to invoke a coroutine. You're using yield in your function which makes it a coroutine.
View Article