Quantcast
Channel: Questions in topic: "javascipt"
Browsing all 1875 articles
Browse latest View live

How to create an RPC call for Photon using UnityScript?

[PunRPC] is giving me the error, it says it's expecting a semicolon at the end which makes no sense. function Update { //A bunch of stuff, mainly I just want to show that [PunRPC] is NOT inside the...

View Article


How to change button text via script?

I know this has been answered before but I have tried everything that other answers have given for the past few days without any success. I'm hoping someone can explain my fundamental misunderstanding...

View Article


How to marshal a callback?

I'm trying to call a simple function with callback from [JavaScript plugin][1]. I have the following `jslib` file: var TestTimeout = { SetTimeout: function(callback, time) { setTimeout(callback, time);...

View Article

Add items from array to a new clone and give them values.

Hey guys, I have a script called Perks and in the script is 3 seperate Arrays all currently strings. An example of these is //likely to start fights "Agressive", //likely to steal money "Thief", //Drug...

View Article

How to combine all meshes in an array (JAVASCRIPT)

I'm making a terrain generation script. I have the perlin noise generation working and what I'm doing now is instantiating lots of "chunks" and putting them into an array. What I have at the moment is...

View Article


I am having a problem trying to simulate football(soccer) physics

I am trying to make a football game and there's that issue that's bothering me: ●Problem: The ball just keeps rolling on the floor no matter how hight the friction value is and it isn't practical for...

View Article

Easiest Way to shake a object?

Hello Unity3D i have a question about objects?what is the easiest way to shake an object in unity3D use javascript?For example i have a gameobject that is a parent to the camera and i want the...

View Article

GUI.Box NullReferenceException

Hi all, im trying to do an Option Menu with a GUI using Box, Button and more. The problem is that when i put the box on the code (in JavaScript) i receive the weird error of NullReferenceException on...

View Article


Can't detect collision.

I have a problem with collision detection. I have my character, he is moving to the z axis automatically. I have some columns and i want to detect collision with the character...but nothing happens....

View Article


Raycast Pause Between Hits?

When the Mouse Button is spammed the raycast hits multiple times instead of waiting till the animation is done any ideas?? #pragma strict var TheDamage = 200; var Effect : Transform; function Update ()...

View Article

MissingMethodException: UnityEngine.Debug.DrowRay

Hello; i got this error: MissingMethodException: UnityEngine.Debug.DrowRay Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher ()...

View Article

[CLOSED] Anything Below This

So I want for what is inside the If to happen when the Z is below/above the number written. But what happens is that CanCreate only gets false when Z is in the number written, not above or below. How I...

View Article

How do I show Unity a variable will exist once the game starts?

So I have a game where a player places blocks in a 2D world. This requires some sort of counter so I put that counter in one script: #pragma strict public var cam : GameObject; public var block :...

View Article


Script failing, mesh spray, "quack" is not generic

I am trying to do a mesh spray custom editor, but keep hitting two problems with EditoGuiLayout.objectfield and the "quack" is not a generic function class MyWindow extends EditorWindow { var...

View Article

Door Script

Hey guys. I have this door script that is supposed to switch between 2 booleans in order to allow the player to open and close the door. Once the door is opened, it switches the openable boolean to the...

View Article


What type of "component?" is a script?

I want to call a function in a c# script from a UnityScript code. I'm using photon unity networking and I can't call an RPC with UnityScript. I want to try having a c# script to do the RPC calls, but I...

View Article

Comparing vector 3 locations

if(Input.GetButtonDown("up")){ //transform.position.currentPos.y = transform.position.currentPos.y+1; currentPos.y = currentPos.y+1; Debug.Log("currentPos"+ currentPos); Debug.Log("startPos"...

View Article


Move my character where i touched

I had problems taking position of my touchplace , i'm getting Index out of bounds error and i cant get any movements , i'm new , help me please. Here's the script ; #pragma strict var amirpos : Vector3...

View Article

[Logical Error] Select a game object and perform actions using GUI.Button

I am currently working on a strategy game and I want to preform actions using **GUI.Button** on game objects. I am using **ray cast** and **mouse click** to select the object however when I click on...

View Article

Easiest way to create a timer?

Hello unity3D.I have a question about timers?What is the easiest way to create a timer in javascript?For example,my characters does this kind of move that makes the camera move to another position and...

View Article
Browsing all 1875 articles
Browse latest View live