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

How to use an inverse tangent in Unity JS?

I am trying to change the direction in which my character is facing using a tangent function. rotation = transform.position.y - yPosBeUp/ (transform.position.x - xPosBeUp) * /*insert inverse of tangent...

View Article


Killing Player doesn't work

I know how to script properly in Javascript, but now i am getting a little crazy here... For some reason my functions aren't working as expected in ANY script. I don' t know if i am too stressed that i...

View Article


Android 2D game how to create swipe left/right views

I want to make a simple 2D android game, and i'm wondering, what is the easiest/correct way to implement different screen views ? My game will have a few different screen views, and i want to be able...

View Article

How, from scratch, can I detect the angle of the ground underfoot a character...

So me and a team are making a game, and I have been assigned to make sure that the characters cant walk up any cliffsides, so I have been working with raycasts. I have found them weird and don't...

View Article

JS If UI.Button is selected

Hello, I'm struggling with UI.Button... I need to run event when Button is selected (not Clicked), but since IsHighlighted is protected, and OnPointerEnter or OnSelect does not seem to work... I'm not...

View Article


Convert Js yo C#

How do I convert the script below to C# It's a script for a third person Camera var target : Transform; var distance = 10.0; var xSpeed = 250.0; var ySpeed = 120.0; var yMinLimit = -20; var yMaxLimit =...

View Article

How can I make A Object have the same Scale as B Object?

I want the "Ghost" Transform have the same Scale as "prefabSelecionado", but The prefabSelecionado is a private Transform (I don't know if it matters), I tried a lot of ways as localScale, lossyScale,...

View Article

Custom Camera Script Toggle Enabled / Disabled

I am designing a first person environment, where the user switches perspective with a third person camera, and with the third person camera, is able to place objects at mouse location. What I am having...

View Article


Help Me Understand why this Boolean is Not Working

Hi Everyone, I have had a look around online but am unable to find an answer that works for me. I would have thought this would be pretty simple. But alas it is not. I have a script that opens a door....

View Article


Changing a Variable in a script from another Object

Hey guys, so i'm aware that this question has been asked a dozen times, but i can't seem to wrap my head around my problem. It's to do with 'Changing a Variable in a script from another Object'. My...

View Article

Calling functions from other scripts with objects

I am aware this is everywhere however my question is a little more specific to objects. The issue i have is the code that is being called has assigned objects to it, the only way i could get it to work...

View Article

Unity 5 Sound repeating when detected by raycast JavaScript

Hello, I have a problem where if a person detects me by raycast he is supposed to stop speaking and then say to go away. Although it is on function update so the raycast detects it 100's of times and...

View Article

Storing timetstamp when building for WebGL with C#

Hi everybody, my problem: I develop for WebGL and want to get and store the timestamp of some user inputs. Two questions: **Is it correct that -- when building for WebGL -- I cannot do this in C#?**...

View Article


Unity2d Error BCE0043: Unexpected token

I'm a noob when it comes to Javascript, can anyone help? I searched online for answers but nothing helped me out... var speed; float; function Start() { void {} { } rigidbody : velocity:...

View Article

Getting index of a String in list

I just need to get the index of a certain string in my list. I am currently using ListName.GetIndex(String) but it tells me that best overload for the method is not compatible with the...

View Article


RigidBody.AddForce example in JavaScript

I can't seem to get the simple tutorial working with JavaScript. #pragma strict var rb; function Start () { rb = GetComponent(''); } function FixedUpdate () { var moveHorizontal =...

View Article

WebGL game slows down after triggering javascript event

I am using Unity WebGL to host my game on a flask server and trying to throw a warning to the user whenever he tries to navigate away from the tab or mistakenly click browser's back button. Each time...

View Article


ReEnable mouse(movement,selection,etc) after loading game menu

So, i have the same problem as it is defined in here: http://answers.unity3d.com/questions/638424/screenshowcursor-true-wont-work-after-screenshowcu.html (i work on Js) The things i know, is that when...

View Article

About UnityScript - us.exe compiler

Hi, With monodevelop, i haven't had any problem writing small standalone hello worlds. new file, hello world code, build and bam. I have a exe. However, this doesn't work with unityscript. the...

View Article

Stack overflow on finite recursion

I tried to make an algorithm to fill all tiles adjacent to each other with the same color, but when I run it it throws the Exception. This is the code: function...

View Article
Browsing all 1875 articles
Browse latest View live


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