Quantcast
Channel: Answers by "ransomink"
Browsing all 80 articles
Browse latest View live
↧

Answer by ransomink

You are declaring the var lGround twice: (1) at the top of your script, (2) inside the Start() function. Anything you declare inside of a function will exist **only** inside the scope of 'that'...

View Article


Answer by ransomink

I found this webpage recently and it's possibly the best way to learn and get into programming/scripting for Unity. It is something you can always come back to and reference in-case you forget how to...

View Article


Answer by ransomink

What he said. I 2nd his response/answer. Always try to check the numbers as they tell you what line the error was found on. At least it's only a typo...

View Article

Answer by ransomink

1. You are referencing the script properly, but inside the inspector, you must add/drag the GameObject (using the CamBob script) into the bobscript (empty slot). 2. Make sure your spelling and casing...

View Article

Answer by ransomink

This is an easy script that will switch the camera upon entering the trigger and revert back to the previous camera when exiting the trigger. Attach this to the trigger GameObject. // INSPECTOR...

View Article


Answer by ransomink

Cambob script public function DoSomething () { Debug.Log ( "You should be doing something..."); } Script that calls the function // this variable will show up in the inspector // place the GameObject...

View Article

Answer by ransomink

You need to create a variable to hold the total amount of spawned balls and a variable for the current amount of spawned balls. Also, use a variable in place of '8' when checking the timer because you...

View Article

Answer by ransomink

Make sure you do **not** place this script on the light GameObject; any other will do. using UnityEngine; using System.Collections; public class ScriptFlashlight : MonoBehaviour { public Light...

View Article


Answer by ransomink

To answer your question (out of curiosity), use this when looking for a tag on a single/specific GameObject: // check if the GameObject has a certain tag if ( TheNameOfYourGameObject.tag ==...

View Article


Answer by ransomink

Because your while loop only creates a random integer once (then breaks), during your for loop, it's setting every integer in your array (randomNumbers) to the same value: randomFace. // if randomFace...

View Article

Answer by ransomink

Use OnTriggerExit2D when an object leaves a trigger collider. You should **not** just set onHand = false; You will need to check if the GameObject that left is tagged "Hand" because any other...

View Article

Answer by ransomink

You should create 2 animations (from the Animation window): **Default** and **ChangeCondition** (or whatever makes sense). The **Default** animation will have your original/default sprite (drap and...

View Article

Answer by ransomink

1. Check if the player has collided with a spawned body 2. If so, spawn a new cube 3. After the cube is spawned, add it to the array spawnPoint on the CubeSpawner script is used as the position of the...

View Article


Answer by ransomink

First off, no one can help if you can't properly tell us the names of your scripts. Adequate info is necessary. Secondly, [@ThomasMarsh][1] gave you the correct answer for accessing a variable from...

View Article

Answer by ransomink

First question: You can create two variables: one which controls the rate of fire (rateOfFire), and the other holds the time of the last shot fired (lastFired). public var rateOfFire : float; // Rate...

View Article


Answer by ransomink

Looks like you're using Built-in Arrays; you cannot resize them, so attempting to remove an item from the array will not work.

View Article

Answer by ransomink

Make sure "FireFrom" is spelled the same inside the hierarchy and the script. Also check that the script is attached to the TurretHead gameobject (just as a formality). I would throw an debug exception...

View Article


Answer by ransomink

You're not disabling the MeshRenderer correctly. It's suppose to look like this: objects[i].GetComponent().enabled = false;

View Article

Answer by ransomink

Dunno what language you need or prefer, but I use JavaScript (UnityScript)...so...yeah. The first method uses StartCoroutine: this is a good/great? workaround if you need to use a parameter(s). public...

View Article

Answer by ransomink

Change: `public GameObject projectile` variable type from GameObject to projectile_Controls: `public projectile_Controls projectile` This way, you can access public variables like: `projectile.decay`...

View Article
Browsing all 80 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>