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

nullreferenceexception object reference not set to an instance of an object

Please Help #pragma strict public var damage :int; function Start () { damage = damage; } function OnTriggerEnter(p : Collider){ if(p.tag == "Enemy") { GetComponent(EnemyHealth).HP -=damage;...

View Article


Top Down Game - Camera Follow Player and General Scripting Question

First off, thanks for reading this! I know that there are a ton of this type of question, but because of the changes to **Unity 5**, many of those old posts don't help me. I use **Javascript** (learned...

View Article


camera falling down when following player!!

I tried many scripts but nothing works. I will go crazy. what can i do for this?? when my player holding to rope main camera slips down. Please take a look: https://sendvid.com/mziuem3u Follow Script:...

View Article

Why Does This Script Freeze My Entire Unity Editor?

For some ungodly reason, whenever I try to implement this script, when I press play to test the game, it doesn't actually play. The cursor disappears and it hangs on the editor, not allowing me to do...

View Article

A script that doesn't allow moving objects to go through non-moving objects?

I have a player, a zombie, and walls. The player does not go through walls or the zombie. The zombie goes through walls. Movement script: var target : Transform; var moveSpeed = 20; var rotationSpeed =...

View Article


How Do I Set A 2D Rigidbidy as isKinematic = true through a script?

#pragma strict var gameController : GameController; var rb: Rigidbody2D; function Start () { rb = gameObject.GetComponent (Rigidbody2D); var gameControllerObject : GameObject = GameObject.FindWithTag...

View Article

Stopping Moving Objects?

I need a non-moving wall to repel a moving object. Moving script: var target : Transform; var moveSpeed = 20; var rotationSpeed = 5; var myTransform : Transform; function Awake() { myTransform =...

View Article

Java to C# and GUI Text to UI Text

I have this Unity script that I would like converted into C# but also if someone could change it so that the Old On Gui Text uses the new UI text on canvas system that would be awesome. var qSamples:...

View Article


Model TextureBlurring Effect (Optimization)

Heya Guys My Game Really needs Some Optimizing and i Came Up With a Idea How to Do so. This is How it works: The Further Objects(FromThePlayer) are Being Disabled And On Their Place are Textures Of...

View Article


Make player spawn at point when loading a scene.

In my game I'm making, I have a top down perspective. Its RPG style and when I have the player enter a building, it loads a new scene and starts the player at the door inside the house. Awesome. The...

View Article

NullReferenceException: Object reference not set to an instance of an object

I am getting the following error NullReferenceException: Object reference not set to an instance of an object Coin.Start () (at Assets/Coin.js:4) This is the two scripts: Coin.js #pragma strict var...

View Article

Im trying to check what scene my player is on, so I can tell unity what scene...

#pragma strict var maxFallDistance= -10; function Update () { if(transform.position.y <= maxFallDistance) { LoadLevel(); } } function LoadLevel () { if(Application.loadedLevelName == ("Level1")) {...

View Article

BCE0077 - Scrolling Textures

Hi, I'm trying to make the texture on a cube scroll to the side and I keep on getting error BCE0077 - idk how good my script is but if you have any alternatives or can find the problems in it then...

View Article


How to access Animation using java script & attach it to the object ?

i have created the walking & idle animation for my fps player. i've added a java_script to access it. but, when i run it & press button(w), it stops & says that, the animation is not...

View Article

Animation doesn't work

I have a lamp and a character, the lamp starts on and the character in idle, i want to do this: when i click the lamp it turns off and the character starts the "lying down" animation, when i click it...

View Article


Is there a way to smoothly change a float number between two numbers when a...

Building a 2D platformer. Making the camera follow the player but provide more room in front of the player's character so that there is less screen space behind them. Important details to know are that...

View Article

Putting a game onto a cd?

How do I burn my Unity3D Game onto a disc? I want this to be pretty straightforward. I built the game, and now I want to just burn it onto a disc. No special consoles or anything, just import the game...

View Article


Ragdoll Rigidbody Array?

I have a script in C# and need to convert it to Javascript, and it involves arrays with rigidbodies. //Rigidbody[] bodies=GetComponentsInChildren(); --> C# var bodies : Rigidbody[]; bodies =...

View Article

LookAt transform plus a y value

I have an object that I want to look at but its transform is where the bottom of the object is and I want to look at the middle of the object. I have tried adding a vector3 but it's not working. help...

View Article

Grey screen in Roll a Ball???

I am doing Roll a Ball Project and using js script instead of C# !.Whenever I press the play button..the game in working in the game view , but everything else is grey!!Here are the screenshots. **My...

View Article
Browsing all 1875 articles
Browse latest View live


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