Expecting EOF, found public
So I wrote this script based off of a script that was used in an answer on this website, but I have a problem: Unity says that public is unexpected and it was expecting the EOF. I'm not sure how to fix...
View ArticleHelp With Camera-Dependent 3rd Person Control
Hello everyone, I'm working on my first 3D platformer in Unity and I could use some help with my custom 3rd person controller. And sorry BTW if this has been asked and answered already! So here's my...
View ArticleSettings menu error
Am....Im new here so im not smartest...xD I got this code: @script ExecuteInEditMode() var menu = true; var options = false; var sound = false; var video = false; var sfxVol : int = 6; var musicVol :...
View ArticleTransform.InverseTransformDirection ALMOST worked with character-facing...
Hello, I'm working on my first 3d platformer and while I've been able to solve a surprising number of problems on my own, there's one thing that has had me stumped for some time. My script: #pragma...
View Articleif boolean == true ...else...
Help with Syntax please!! Boolean is triggered once but never makes it to else or next part to be false: #pragma strict var animator : Animator; var myBool : boolean; function Start () { animator =...
View ArticleWhat function does { } have in javascript?
I'm new to scripting, and recently I got stuck on a script. There was one 'Unexpected Token' error. Out of ideas, I added { } before it a couple lines above. This somehow fixed the error. I usually...
View ArticleHow to move 3rd person controller in camera's local space?
Hi, I have a dilemma which may be harder to explain than it is to solve. I've asked this in the help room twice already with no luck, and anyone I found who asked about this in the past just left the...
View ArticleDestroying GameObject in NetworkBehavor with Javascript
I'm incredibly frustrated I have worked for 3 and a half hours trying what feels like every different method in the scripting API. And it still doesn't work, unless I remove he NetworkBehavior, but I...
View ArticleNullReferenceException: Object reference not set to an instance of an object
I am getting the following error in my script and i dont know why here is the script NullReferenceException: Object reference not set to an instance of an object Coin.OnTriggerEnter2D...
View ArticleExpecting EOF found 'Public'
I asked this question before, and it was answered. The problem was fixed. However, there's a second "Public" in the script that isn't recognized. I'm out of ideas now. I'm a beginning JavaScript user....
View ArticleMy timer is not slowing down why?
hello, I have build a timer with a cutout it works perfect but if i want to slow it down it wont work here is my script: #pragma strict var speed: float; var rend: Renderer; var control: controller;...
View ArticleWhy can I not change my font style in javascript?
Me and my team are creating a game and we can't figure out how to change our style of font in our code. We have tried a couple different ways to do in none of which worked. Now we are down to one...
View ArticleJS to CS conversion problem with multiple class files
So I'm converting a few javascript files into c# files for basic continuity purposes. These JS files came from an outside source, but work in their current state. One particularly big file contains...
View ArticleBest way for a raster inventory
Hi folks. I've already wrote a complete inventory script, based on list operations, where i can add items, drop them, use them instantly, equip them, put them into a container or drop the whole...
View Article[JS] Custom camera rotation resets on Var change?
Hello everyone! Right now i am in the proces of making a custom third person character, and i am currently working on getting the camera to work. However, when i change the rotatesensitivity in the...
View ArticleHow to switch mouse with arrows !
Hi, i am a novice programmer and i need to eliminate mouselook from FPS Controller in Unity and change with the right side and left side arrows form the keyboard to make an old style shooter.can any...
View ArticleEditorUtility.OpenFilePanel for UnityWebGL (Runtime)
I want the user to select a image from computer in Unity WebGL game but I am not able to get any library or code for this thing. I want exact functionality of EditorUtility.OpenFilePanel for UnityWebGL...
View ArticleRotating Rigidbody properly using AddRelativeForce
horizontalMovement = Vector2(rb.velocity.x, rb.velocity.z); if(horizontalMovement.magnitude > totalSpeed) { horizontalMovement = horizontalMovement.normalized; horizontalMovement *= totalSpeed; }...
View ArticleRootmotion fall
I created a 3RD person game with root motions animations to add more realistics movements, but i just started to add falling animations (without rootmotion, with rigidbody only) and this is the result:...
View ArticleAccessing variables across scripts in JS
I am trying to access this variable (id) in a different script than the one it is created in. I have done this before in other projects and it worked which leads me to believe that it has something to...
View Article