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 ArticleEnemy 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 ArticleRolling 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 Article2D 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 ArticleHow 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 Articleenemy 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 ArticleScreenshot 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 ArticleHow 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 ArticleMy 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 ArticleUsing 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 ArticleLerp 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 ArticleHow 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 ArticleTrying 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 ArticleKeeping 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 Articleneed 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 ArticleUI 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 ArticleNullReferenceException 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 ArticleDontDestroyOnLoad & 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 Articleproblem 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