Tagged Questions
0
votes
1answer
31 views
How to use sprite as font in Unity?
I've started working on my first game in Unity; It's very simple, there's a spinning block in the middle, and there are spinning blocks coming from all sides. When they hit the middle block, you lose ...
1
vote
3answers
84 views
Freeze Player position temporarily?
I'm making a 2D sidescroller (although it's technically being made in 3D), and I need to freeze a player's position temporarily. With a RigidBody, this would be simple, but I can't think of how to do ...
-1
votes
0answers
27 views
Unity 3d: the difference developping in javascript/C#? [duplicate]
What is the difference(strong or weak)? I have asked several programmers, but they told me there is a preference topic.
-2
votes
2answers
66 views
C#Script select GameObject
I want to load the prefab instead of the gameobject that is in the screen, my code is this one:
using UnityEngine;
using System.Collections;
public class Arma : MonoBehaviour {
public static int ...
2
votes
1answer
87 views
Inverse Explosion with Unity2d
I am currently trying to make all other objects push away from the player when the player explodes. It currently works, but it pushes close objects a little and far objects very far. What I want is ...
0
votes
1answer
99 views
Problem with Raycasting in a 2D Game
I'm new to using unity and came across a problem when I was following a tutorial. The game is in two dimensional space, and when my player walks over a certain tile the detection never goes off. ...
1
vote
1answer
78 views
Unity3D - Android pause screen - double click issue [closed]
I made a pause script for the game im developing for android.
I added the script to the GUITexture I created and placed on the top right side of the screen.The issue stands at the part where if the ...
4
votes
2answers
549 views
How to ignore collision between two objects
I have a player that shoots in the direction that it is facing. However, the shot that is created when I click, also destroys the player (example). How would I make the shot ignore collision with the ...
3
votes
3answers
104 views
How to launch a prefab at the mouse position
I want to use Instantiate(item, new Vector3(...), Quaternion.identity) to land an item at the position that was clicked. My game is using a third-person view (example).
This is the code that I think ...
-1
votes
4answers
169 views
How to increase the game “level” after certain amount of objects spawned?
The game is supposed to increase the level by 1 every 10 spawns of an object, using totalShots % 10 == 0. So, when totalShots is equal to 10, 20, 30, etc. the level should increase by 1, however, the ...
0
votes
1answer
143 views
How to randomly spawn object using instantiate
I'm trying to spawn objects which move in one direction until they hit a player or the barrier. The spawner is a cube which moves between two points to spawn the object at different locations.
The ...
1
vote
2answers
120 views
Object goes straight through game object without colliding
The "shot" is supposed to collide with the left bumper and then be destroyed, but the shot goes right through it. Both objects have a box collider.
The following is the code I am using:
#pragma ...
2
votes
0answers
49 views
Certain sound is played after last if within script [closed]
The idea is to make the sound work when comboTime is false.
However, it works in an unexpected way: the sound works after the last if statement within ComboHud.js, which is:
if (Time.time > ...
1
vote
1answer
160 views
How do you set the target location for a navmesh using a GameObject?
I am trying to get a GameObject to navigate through a map and get to the exit. I have created a navmesh for the map and given the player GameObject a navmesh agent. The exit is marked with a empty ...
0
votes
1answer
61 views
GameObject remains null for some reason
The idea is to access the function BlockWasDestroyed(); from Combo class.
Instead of var combo = gameObject.GetComponent(Combo); I've also tried with
var combo = GetComponent(Combo);
var ...
2
votes
2answers
227 views
android game development using unity 3d [closed]
I want to learn android game development. I dont have any programing knowledge. So should I learn JAVA and eclispe to develop games for android.
Or should I learn Unity 3d. And is knowledge of java ...
0
votes
1answer
161 views
Error when using GetComponent (Object reference not set to an instance of an object)
I'm using a textmesh to check variables in real time. Thing is if I use AddComponent within Update(), it obviously starts spamming and slows the game. If I try with GetComponent the error is the ...
1
vote
1answer
37 views
Wrapping each script with classes causes errors
The goal here is to change variables from another script. Thing is that they must be in classes, so for example I wrapped this code (which is from PadControl.js):
#pragma strict
public var ball : ...
1
vote
1answer
70 views
Can't edit specific variables from the inspector panel, while variable is static
In order to make the variable accessible from other classes, I have to make it static.
When I make it static, I can't edit it from the Unity's Inspector panel.
No way to be able to do both: ...
0
votes
1answer
41 views
What is the actual formula to find the vertices of an animation frame in using a BVH file?
I've read this tutorial and tried many formulas to build the skeleton. I am able to build it without the rotations, but those break everything. This, for example, is a simplified code for one of my ...
0
votes
1answer
168 views
How to play a video on a TV model inside a game?
I am new to Unity3D. I need to know how can I play news when I switch on a TV using any scripting language in Unity3D ?
4
votes
3answers
666 views
Differences between C# and Javascript for Unity [closed]
Apart from the language differences (class-based vs prototypical, strong vs weak typing), what are the differences between using Javascript and using C# when developing games in Unity3D?
Is there a ...
1
vote
1answer
296 views
How to continuously create objects in front of the camera when moving forward?
I have created a scene in Unity3D that's filled with spheres. I want to be able to move forward forever and still be passing through the spheres.
I was thinking I'd keep the player in one spot and ...
0
votes
2answers
88 views
Unity3D JavaScript/.NET code throwing compilation error with a List-thingy [closed]
So, I do this:
var intlist:List.<System.Int32>;
intlist.Add(1);
And where I say intlist.Add(1) I get:
NullReferenceException: Object reference not set to an instance of an object
Weird, ...
1
vote
2answers
1k views
Pass parameters from html page to start() function in unity3D webplayer application
I want to pass a parameter from web browser to Unity3D web player as soon as it is loaded. I know that, as soon as the web-player is loaded, the start() function is execute inside web-player. So I ...
0
votes
0answers
31 views
How can I get url variables in unity flash? [duplicate]
I recently looked into getting url variables in unity webplayer, I got the full url including parameters form javascript and parsed it in C#, but now in flash I cant call
javascript, so how can I get ...
1
vote
1answer
826 views
Get MonoBehaviour components from Prefab
I need to assign the script values for the following Prefab in Unity 3.5
The structure is the following
Kinect_Prefab
-MonoBehaviour
·Script: Missing Mono Script
-MonoBehaviour
...
1
vote
2answers
481 views
Dynamic Textures
I am pretty new to this 3D designing and animating, and as an indie developer I need to do everything on my own
I have created this simple box character And I want to texture it, have looked around ...
2
votes
2answers
436 views
How to make a Unity3d program/plugin and publish it on Asset Store?
I want to make a plugin for Unity3d, like TornadoTwins's FPS Control. How can I do that? I already have Visual Studio 2010 installed.
0
votes
1answer
753 views
Unity - Code is fine in the editor, has error on android
Right. Im running into some weird issue with android unity. I have this bit of code
function OnTriggerStay (other : Collider)
{
if(die.GetComponent(DieScript).sideUp ==6 ...
2
votes
1answer
2k views
Unity3d - setting gameobject position by percentage of view
I am having trouble finding a way to set a gameobject's position with regards to the screen size. I am building a 2d game that I will be putting on iPhone, iPad, and Android. I need to be able to set ...
2
votes
2answers
2k views
Creating an object in javascript with unity (unityscript)
So I have a ton of experience with JavaScript (its what I do for a living) but I am new to unity. I have built a game engine in javascript but now want to move it over to unity. I have been trying to ...
2
votes
4answers
2k views
Unity: Assigning a key to perform an action in the inspector
I am trying to write a simple piece of code in JavaScript where a button toggles the activation of a shield, by dragging a prefab with Resources.load("ActivateShieldPreFab") and destroying it again ...
1
vote
1answer
569 views
Performing simple network call to retreive JSON in Unity?
I have looked at the network documentation for Unity and most examples seem to be related to networking your game for multiplayer. I am just looking to grab a JSON response from an API for dynamically ...
1
vote
2answers
4k views
Find all Game Objects with an Input string name (not Tag)
I'm trying to mimic FindGameObjectsWithTag with FindGameObjectswithName. I know using tags is faster, but I'm trying create a way to search for objects I spawn with a child object I name on ...
4
votes
1answer
626 views
Unity Deactivating a gameObject
I'm trying to deactivate an GameObject when a certain variable reaches a certain value.
It is an imported FBX and doesnt have a MeshRenderer. I'm trying to stop it now with ...
4
votes
1answer
2k views
Unity MouseWheel weapon change
I am trying to make a simple weapon change in Unity3D. The best way to do this is with the mouse scroll wheel, as far as I can see.
I googled on how to do this and found that I have to use ...
2
votes
2answers
1k views
How can I get my first-person character in Unity to move to a ledge with an animation?
I'm trying to get this to happen:
The character walks up to a large crate, the player presses a button, and an animation starts playing where the character climbs up on to the crate. (all in first ...
12
votes
4answers
5k views
Ledge grab and climb in Unity3D
I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it.
Now my question, since I've been ...
0
votes
1answer
144 views
Strange javascript error when using Kongregates API
In the hopes of finding a fellow unity3d developer also aiming for the Kongregate contest..
I've implemented the Kongregate API and can see that the game receives a call with my username and presents ...
8
votes
2answers
2k views
Top down space game control problem
As the title suggests I'm developing a top down space game.
I'm not looking to use newtonian physics with the player controlled ship. I'm trying to achieve a control scheme somewhat similar to that ...