Quantcast
Channel: Answers by "Dreamblur"
Browsing all 56 articles
Browse latest View live

Answer by Dreamblur

First of all, MovieTexture.isPlaying is not a script -- it's a variable in the MovieTexture class. And it's not a static member, which means you can only access it from an instance of the MovieTexture...

View Article



Answer by Dreamblur

Replace this line: if(Input.GetButtonDown("Fire1") && shots

View Article

Answer by Dreamblur

There is no key named "Jump." Your code applies a force of on the rigidbody during a single frame. Since the default ForceMode parameter of Rigidbody.AddForce() is ForceMode.Force, your rigidbody is...

View Article

Answer by Dreamblur

Get the positions of the player and of the enemy. Subtract those two and use the resulting vector as the direction vector for the velocity. No angle calculations required. EDIT: Kinda tricky with the...

View Article

Answer by Dreamblur

Make your arrays static. static var enemies : GameObject[]; static var items : GameObject[]; To access from any script: LevelArrays.enemies[0] (I've been using C# more than UnityScript lately, so if my...

View Article


Answer by Dreamblur

There's an error in one of your scripts. Fix the error first.

View Article

Answer by Dreamblur

First, get the position of wherever the objective is. Then, subtract the position of your character from that position to get the direction vector. Then, depending on the direction vector, switch the...

View Article

Answer by Dreamblur

A yielded coroutine will resume execution after all the Update() methods in the current frame have been called. Use: yield new WaitForEndOfFrame(); in your code rather than yield. EDIT: Actually, I...

View Article


Answer by Dreamblur

transform.right points to your game object's local x-axis. transform.up points to your game object's local y-axis. transform.forward points to your game object's local z-axis.

View Article


Answer by Dreamblur

You forgot to put a semi-colon after the last variable before your Start method.

View Article

Answer by Dreamblur

Either pilot isn't initialized or it doesn't have a ConstantForce component attached to it.

View Article

Answer by Dreamblur

Quaternion.SetLookRotation

View Article

Answer by Dreamblur

Here's an incomplete answer: using UnityEngine; using System.Collections; public class SnapAndAlignScript : MonoBehaviour { private Transform thisTransform; private Vector3...

View Article


Answer by Dreamblur

Backslash. EDIT: UA used my backslash. XD Hold on. `"\""`

View Article

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 Article


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

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


Answer by Dreamblur

if(whatever) { score += x; bonusCheck += x; if(bonusCheck >= scoreToGiveBonus) { // perform bonus function (bonusCheck / scoreToGiveBonus) times bonusCheck %= scoreToGiveBonus; } }

View Article

Answer by Dreamblur

Application.platform returns an enum-type value representing the platform the build is currently running on.

View Article

Answer 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 Article
Browsing all 56 articles
Browse latest View live




Latest Images