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

Text wont change to correct value

So I'm not very experienced and I've been working on a game where you have to tap at the right time to get points. In this gamemode, if you don't tap when the timer hits 0, or if you tap at the wrong...

View Article


Enemy movement in javascript?

I currently have a javascript code for a 2D game with an enemy that patrols a platform. Using the width of the sprite, it detects the edge of whatever collider it is on and flips the sprite. I...

View Article


Rolling rigidbody cube in Unity3D

So in Unity3D I have a cube which is being controlled by a player(using arrows). Player can go wherever he wants with the cube. The problem is when I add rigidbody to the cube then it doesn't really go...

View Article

2D Enemy patrol using javascript

I have a javascript code for enemy patrol that I translated from C#. I am not flagging any errors from it, but my enemy flips back and forward rapidly and does not patrol. basically using a linecast to...

View Article

How do I make a Bounce/trampoline script?

I have been looking for a trampoline type script everywhere and I can't find anything. If you don't know what I mean by Bounce/Trampoline. Well you know the Bounce springs from Sonic? That's what I'm...

View Article


enemy patrolling using javascript???

Something is odd with my javascript for a simple enemy patrol for my 2d platformer game. It detects the edge of the collider it is walking on and flips the sprite. My script isn't triggering errors,...

View Article

Screenshot to variable

I have been trying to make a script that save a screenshot and puts it into a variable. When it is in that variable, I would like to put it on the screen as a UI.Image. I was looking at...

View Article

How to change scene in 1.3 (Using Javascript)

I have found information on how to do this in C# however, can not get it to work using javascript.

View Article


"NullReferenceException: Object reference not set to an instance of an...

This script is acting strange... I have tried solutions from other answers but they don't seem to work at all. I have a ray that constantly checks for GameObjects with the layer "Interactable". The ray...

View Article


My character's Y Rotation is not equal to camera's Y rotation.

https://www.youtube.com/watch?v=Mj5p-BOWvqs Apparently instead of the rotation being from 0-360, it's 0-1 with 1 being 180. public var gsp : float; public var maxGsp : float; public var acc : float;...

View Article

Using CanvasGroup to fade between scenes in new UI

Hello. I'm trying to figure out a way to make fade out/ins between scenes using CanvasGroup. However all the code I can find online for this is no longer recognized. If you guys could help me out that...

View Article

Lerp is instant. How to fix?

I'm trying to interpolate a float value from one value to another value over a time. These 3 are parameters for the function containing the Lerp. Here is the code. //Function to scale player up and...

View Article

How do I make unity generate a random equation and an answer to to it (also...

Hi, so what I am doing here is making a math game (for a school project) where there is an equation that pops up in the top of the screen and then you have to push a ball in a hole with the right...

View Article


Trying to use coroutines in order to use Mathf.Lerp, Lerp instantly jumps values

What am I doing wrong? function scalePlayer(scaleTo : float, timeUp : float, timeDown : float) { StopCoroutine("scaleTo"); StopCoroutine("scaleBack"); StartCoroutine(scaleTo(scaleTo, timeUp)); yield...

View Article

Keeping points tallied

Hey all! I'm currently working on an arcade style game where you fire spheres at targets to gain points. Something is not quite right with part of my code, though. Whenever the player character fires...

View Article


need help in randomising array

var startPoint: Transform[]; var endPoint: Vector2[]; var RandomNumber: int; var speed: float; RandomNumber = Random.Range (0,3); function Start () { startPoint.position =...

View Article

UI Text showing weird string value?

I have this script that essentially selects an object using Raycast and displays the name of it via Text UI. Everything works fine, but the text that appears on screen when the object is selected is...

View Article


NullReferenceException on second line but not first?

Hi, I'm running this code:function Update () { if (Active){ transform.rotation = Quaternion.Slerp(transform.rotation, Target.rotation, Time.deltaTime * Smooth); transform.location =...

View Article

DontDestroyOnLoad & Destroy clone, missing text component

I make script DontDestroyOnLoad & Destroy clone and attach on Canvas where is text: function Awake () { // Make LevelData a singleton, so we keep ourself alive and kill any clones if (...

View Article

problem with script

hi im doing a game where is posibble to enter a car. i made my own script that enables car controller script in car object. but there is a problem: when i click "e" nothing happens. #pragma strict var...

View Article
Browsing all 1875 articles
Browse latest View live


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