Changing Material In A Script? [Sorted]
How would I change a material in a script. I am generating infinite terrain though for my blocks I can't change the material... Everybody elses code doesn't work on mine for changing materials.
View Articlehow to run 3rd person automaticaly
I am making a racing game in unity like Temple Run where the player needs to constantly run and collect fruits/ power ups. I am using the 3rd person default construction worker to make this work. But...
View ArticleWhere is the missing semicolon?
I just need to get the objects with the "Gravity" tag. Here is the error:Assets/Scripts/PlanetGravity.js(11,24): UCE0001: ';' expected. Insert a semicolon at the end. Here is the line: var...
View ArticleHow I can find the complete event of my animation
I am creating a demo in which I play two animation one is default which always run in background and one is when I clicked on my button. I want my default animation stops until my clicked animation not...
View Article';' expected. Insert a semicolon at the end. I already have a ;
It says the error is in the second line under the movement check but I already have a semicolon. I tried to figure it out but I have no idea what to do now. function Update () { //Movement Left and...
View ArticleAnimating main player when click on object
Hii,, I am new to unity as well as scripting plz bare me.. i am trying to play an animation of my main player when i click on the other object... for instance i am trying to do script(Java only) to...
View ArticleHelp with OnTriggerEnter and mouse down
Hello. I made a script, which in theory should work, but doesn't. I want it to when I click, while in the collider, destroy the prop and display the phone. It's kind of like a fake pick-up system....
View ArticleJavascript unexpect "f" value
For this code im getting an error saying:"BCE0043: Unexpected token: 2.0f. " > if> (Physics.Raycast(myTransform.position,> -transform.up, out hitInit, 2.0f, initPosMask.value)) {extra code...
View ArticleDisabled Script Enables Itself
Hey guys. The script below is something I made real quick. I disabled the script in the inspector, and made it so it turns itself on when an OnMouseDown function is executed. Basically what I want is...
View Articletarget variable of another script
How do I target the multiplier? I keep getting confused by the samples. ![alt text][1] [1]: /storage/temp/53947-target.jpg
View ArticleRotate Y over time
There is lots of post on this and I cant get it to work function Increment() { Count++; if(Count == CountTo) { //if(Gate.transform.Rotate != (0,90,0)) //{ Gate.transform.Rotate(0, 90, 0); //} } } That...
View ArticleCall Android method without JAR or without specifiying bundle id?
Hello guys, The title pretty much sums it up all. Do we really need to specify the bundle id in the JAR file that would be compilated, or to include the JAR file at all? It is really a pain in the ass...
View Articlescore counter not working
well i have been trying to fix this problem for a few days now and i still can't find the problem. my score counter wont register. for some reason it wont make the connection from my controller script...
View ArticleCan anyone please tell what to do make a bomb explode on touching ?
i am making a military scene where a the first person controller go and steps on a mine . i made the mine but how to make it working ??? any help would be appreciated.
View Articlenullreferenceexception object reference not set to an instance of an object
Please Help #pragma strict public var damage :int; function Start () { damage = damage; } function OnTriggerEnter(p : Collider){ if(p.tag == "Enemy") { GetComponent(EnemyHealth).HP -=damage;...
View ArticleAdd a variable into a statement?
I'm going through a scripting tutorial and it's talking about if statements. It has just shown me how to do... if (playerHealth <= 0) print ("You're Dead"); What if I wanted to do an else statement...
View ArticleAdding sound to a script trigger
Hello, I got small Jump scare script that I would like to add sound to it and destroy it after one trigger. I added the variable but i just can't figure out how to get it to work. I would appreciate...
View Articledont have autocomplete in java script
please reply i dont have autocomplete in java script but in C# founded what i do ? i need autocomplete in javascript.
View ArticleGun shooting help
I am creating a game where you are the starting as the unity jet object. There will be other planes that are enemies that are going to follow the player and shoot him. Right now I am trying to make the...
View ArticleWhat do I do when This error shows up ?
Please Help ! What Do I Do when this ERROR shows up : Assets/KillOnHit.js(8,9): BCE0044: expecting), found 'var'. From the Series of MAKE A GAME (By Brackeys) Video 22 The script : ![alt text][1] [1]:...
View ArticleBrowser Error: Window function is not a function when called from WebGL...
Hello, I am trying to send data from my WebGL player to a JavaScript function declared on the window. However, I keep getting an error: Uncaught TypeError: window.relayImgurData is not a function Here...
View ArticleJavaScript Error
I have a JavaScript that whenever i press a button, in this case "j", it will play an animation (walk). But whenever i use the script on a FPS Controller in standard assets, it says all compile errors...
View ArticleDid unity 5 discontinue unityscript/javascript and go strictly to c#?
The version 5 uprgaded my project and threw right into c#. Has Unityscript been dropped in favor of c#? I cant seem to find a specific link due to all the other links of history on the web. Thank you...
View ArticleReset score to 0
I can't figure out what is wtong with my code, I wan't the score to reset when I collide with a specific tag but nothing happens? How can I do this with javascript. #pragma strict static var score :...
View Articlehow to fix menu button "play"
var play = false; var Developer = false; var Quit = false; var Camera1 : Camera; var Camera2 : Camera; var back = false; function OnMouseEnter() { GetComponent.().material.color = Color.red; } function...
View ArticleAfter Draging and droping "javaScript" into the GameObject, the "JavaScript"...
After draging and droping JavaScript into a GameObject,...JavaScript refuse to appear in the inspector,...note that in the inspector,..only the Target appears very bold. while the script is xtremely...
View Article*JavaScript* High Score help (Need help with player prefs)
I have to make a high score display on the game over and menu scene, Right now I have just once you die, it displays the score you had gotten from that run on the game over scene and then resets wen...
View Articlehelp with mono development and javascript?
NullReferenceException: Object reference not set to an instance of an object fillinventory.Start () (at Assets/script/fillinventory.js:13)
View ArticleProblem with simple JavaScript, No appropriate version of...
Problem with this script, am I just really stupid because I can't find the problem. #pragma strict var Health : int; var explosion : GameObject; var target : Transform; function DeductPoints (Damage :...
View ArticleCan't add script behaviour TMP_CoroutineTween. The script needs to be derived...
I have been doing some jimmyvegas unity tutorials on youtube. he has one for a space ship game for android and ios devices, its basically an endless runner, I have made 3 sections of the endless level...
View Article