Top Questions - UnityAnswersmost recent 30 from http://answers.unity3d.com2010-03-15T23:24:38Zhttp://answers.unity3d.com/feedshttp://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://answers.unity3d.com/questions/5771/jcar-help-neededJCar help neededRakesh Jha2010-03-15T12:49:50Z2010-03-15T23:23:43Z
<p>Plz help i have applied the jcar script from unity but my car accelerates very fast after every animation help....</p>
http://answers.unity3d.com/questions/5808/exporting-maya-animation-to-unity3dExporting Maya Animation to Unity3dEvan Dawod2010-03-15T23:19:12Z2010-03-15T23:19:12Z
<p>Hi,</p>
<p>I have created an animation in Maya, and it contains a bone structure with IK Handles. I have tried to Bake the IK Handles and Bones and export as FBX. But when i import to Unity3d and choose bake animations and import to the environment and press play. nothing happens. The character doesn't move at all...</p>
<p>am i doing something wrong? any advice would be great?</p>
<p>Thanks,</p>
http://answers.unity3d.com/questions/5797/model-rotation-and-hierarchy-of-game-objects-not-rotatingModel rotation and hierarchy of game objects - not rotating!Michael2010-03-15T20:09:09Z2010-03-15T23:12:17Z
<p>Hi all,
I'm new to unity3d but have programmed 3D apps before. I have a hierarchy like this:</p>
<p>Player</p>
<ul>
<li>body</li>
<li>shorts</li>
<li>shoes</li>
</ul>
<p>Player, body, shorts, and shoes are all GameObjects. Player is used just as a container and is the parent of the other parts. Each of the children has a Mesh and a Mesh Renderer. I am trying to rotate the entire player so I thought I could just modify the rotation of the Player transform. I can see the y-value of the rotation changing in the inspector when I run my script but the 'model' does not rotate. I can't understand why this doesn't work.</p>
<p>Am I missing something unique to unity?
Thanks</p>
http://answers.unity3d.com/questions/5800/cheetah-3d-animation-exportsCheetah 3D Animation ExportsLyndonT2010-03-15T20:54:11Z2010-03-15T23:09:15Z
<p>Will the Cheetah 3D ".fbx" animation exports work in Unity 3D? If so, will I lose any animation features that I created in Cheetah?</p>
http://answers.unity3d.com/questions/5544/collection-script-troublesCollection Script troubleskarl2010-03-11T23:24:35Z2010-03-15T23:07:48Z
<p>In this script we are trying to collect items on collision. So far it is not working. It will not update the gameObject but it is recognizing the hit in the debug log.</p>
<blockquote>
<p></p>
</blockquote>
<pre><code> var honey_num = 0;
function OnControllerColliderHit(hit:ControllerColliderHit)
{
if(hit.gameObject.tag == "honey_gold")
{
//Get the Honey Counter Object
//var honey_counter = GameObject.Find("HoneyCount");
Debug.Log("Zam Gets a HoneyComb");
Destroy(hit.gameObject);
honey_num++;
//honey_counter.gameObject.GUIText.Text = honey_num;
}
}//END FUNCTION ONCONTROLLERCOLLIDERHIT
</code></pre>
http://answers.unity3d.com/questions/5802/fading-terrian-and-blocking-pathsfading terrian and blocking pathsFishman922010-03-15T21:13:20Z2010-03-15T22:15:08Z
<p>Is it possible to fase terrain at the edges, and add like an invisible wall to stop the player falling off the level?</p>
http://answers.unity3d.com/questions/5804/using-f-with-unityUsing F# with UnityNis2010-03-15T22:05:16Z2010-03-15T22:05:16Z
<p>I am trying to use F# with Unity.</p>
<p>But when I compile an F# program to a DLL and import the DLL in my assets folder in Unity, Unity gives me the following error:</p>
<p>"GLib: Cannot convert message: Conversion from character set 'UTF-8' to 'CP1252' is not supported"</p>
<p>What can I do to use F# DLL's in Unity?</p>
http://answers.unity3d.com/questions/5394/javascript-editorJavascript editorIain2010-03-09T18:47:32Z2010-03-15T21:26:23Z
<p>Hi..</p>
<p>Sorry I am a total beginner on Unity and have little to no knowledge of scripting but this engine seems the most user friendly of many tried. I have read that some editors have auto complete to help in scripting is it possible to use one of these with unity.. if so which editor would be best. I had a look at Unitydevelop but it does not seem to work for me.</p>
<p>Thanks in advance.. Sure I will be here a lot over the next few weeks</p>
http://answers.unity3d.com/questions/5799/fading-an-object-via-scriptFading an object via scriptelbon962010-03-15T20:46:49Z2010-03-15T21:06:35Z
<p>How would you fade out an object via script? I've got a cube that needs to completely disappear - slowly fading out, not just turning off the rendering. I tried the example from the documentation, but it doesn't seem to do the trick. The cube just disappears instantly; not the effect I was looking for. Here's the code I have currently:</p>
<pre><code> var colorStart = Color.red;
var colorEnd = Color.green;
var duration = 1.0;
function Update () {
var lerp = Mathf.PingPong (Time.time, duration) / duration;
renderer.material.color = Color.Lerp (colorStart, colorEnd, lerp);
}
</code></pre>
<p>It's directly copied from the docs but won't fade over time - it's instantaneous. I would appreciate a pointer or two.</p>
<p>Thanks in advance - Elliot Bonneville</p>
http://answers.unity3d.com/questions/5798/how-to-make-a-basic-vehicleHow to make a basic vehicleelbon962010-03-15T20:36:00Z2010-03-15T20:36:00Z
<p>I and wondering how to make a basic vehicle script. I'm vaguely aware that you would have to use wheel colliders, but I'm not sure how or where. Could somebody provide some resources or just tell me? I'm making an AI tank, and was hoping that I could just rotate the wheels and make them children of the body, and with the right physics setting, do most of the work without script. Is that even possible?</p>
<p>Thanks in advance - Elliot Bonneville</p>
http://answers.unity3d.com/questions/3413/type-object-does-not-support-slicing-array-helpType 'object' does not support slicing - Array help!Peter B-B2010-01-31T01:49:59Z2010-03-15T20:24:25Z
<p>Hi,</p>
<p>My array isn't working, and I have no idea how to fix it. The array information in the documentation is rather limited. I removed the unnecessary parts of my script to get the meaning across:</p>
<pre>
var record : Array:
var arrayNumber : int = 0;
//globalScript.globalScript.generation = global variable, integer, increases by 1 every 10 seconds or so
//globalScript.globaltime = global variable, the time in seconds. it resets for every generation
Update()
{
record[globalScript.generation][arrayNumber] = Array()
record[globalScript.generation][arrayNumber][0] = globalScript.globaltime;
record[globalScript.generation][arrayNumber][1] = position; //the position of my object, defined elsewhere
arrayNumber++;
// if (first of the generation) { arrayNumber = 0; }
}
</pre>
<p>Does anyone know how to properly insert arrays in to arrays?</p>
<p>I'm desperate! Please help!</p>
<p>Thanks</p>
http://answers.unity3d.com/questions/5772/health-bar-centeringHealth Bar CenteringWillem2010-03-15T13:07:15Z2010-03-15T20:09:00Z
<p>I currently have the framework in place to have a bunch of little enemies, all with their own health, and I was wondering how I would go about creating health bars that hover over their heads?</p>
<p>Ive got code that creates a GUI rect that scales with the players health, but the GUI stuff uses a different coordinate system(or so I think) that makes it difficult to center over the enemies. </p>
<p>Is there any easy way anyone can think of to create health bars that hover over the enemies on screen?</p>
<p>Thank you for any help :)</p>
http://answers.unity3d.com/questions/5792/4-questions-for-character-developers4 questions for character developers.Nazukan2010-03-15T18:11:44Z2010-03-15T19:57:33Z
<p>Okay my first question: is where can i create my own custom character and weapons? I know there's 3d max but it seems to me i have to pay for that.</p>
<p>My second question is:how do i connect a weapon to a 3rd person character?</p>
<p>Third is in the build for a character they have animations. How do i get the animations and how do i apply them correctly. All i need is some simple ones like walk, run. idle, shoot, and jump. </p>
<p>My last question is: If anyone has made a sword and has all the scripts and everthing attached can you lend me one. I'm trying to create a game that's main charcter can switch between guns and a sword.</p>
http://answers.unity3d.com/questions/2779/delta-event-out-of-editor-problemDelta event out of Editor ProblemDavid2010-01-16T20:46:10Z2010-03-15T19:23:24Z
<p>Hi,i´m using Event.Current.delta to move a texture arround the screen. The problem comes when i build the scene. Current delta goes crazy and doesn´t stop never. </p>
<p>If i stop moving the mouse texture keeps mooving on the last direction.</p>
<p>Thanks</p>
http://answers.unity3d.com/questions/5583/how-can-i-find-specific-parts-of-an-xml-and-feed-them-into-dialogueHow can I find specific parts of an XML and feed them into dialogue?Veliremus2010-03-12T12:24:33Z2010-03-15T19:14:39Z
<p>I've tried googling and searching Unity Answers/Forums, but all I come up with are things to load entire XML documents. What I would like to do is make a Javascript (preferably Java) that will allow me to read specific dialogue lines from an XML file.</p>
<p>I got this, which seems to be similar to what I need: <a href="http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=312&page=1" rel="nofollow">http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=312&page=1</a> (also found an XML parser, but that loads entire XMLs as well[?]: <a href="http://forum.unity3d.com/viewtopic.php?t=40708&highlight=xml+parse" rel="nofollow">http://forum.unity3d.com/viewtopic.php?t=40708&highlight=xml+parse</a>)</p>
<p>But I have no idea how I would turn this into Javascript, I'm really a beginner.</p>
<p>So, in short, I want a script that can read, for instance, this XML:</p>
<pre><code><scenes>
<scene1>
<actor>Bob</actor>
<line1>"Oh, hi thare!"</line1>
<line2>"This is my second line."</line2>
</scene1>
<scene2>
<actor>Bill</actor>
<line1>"I'm another actor!"</line1>
</scene2>
</scenes>
</code></pre>
<p>Naturally I would want to load that function from another script. I hope you can help me out! If there is more information needed, I'll be happy to supply it.</p>
http://answers.unity3d.com/questions/5793/turn-off-shadows-for-a-specific-cameraTurn off shadows for a specific camera?Bob2010-03-15T18:45:40Z2010-03-15T19:06:12Z
<p>Hello,</p>
<p>I have two cameras in my scene. One is a top-down camera that is used to render a "radar" (2D) on the HUD. The other camera is the 3rd person gameplay camera that follows the player.</p>
<p>I also have a single directional light in my scene that generates shadows. For my top-down camera, I do not want shadows to be rendered. For the player camera I do want shadows to be rendered.</p>
<p>Is there a way to turn off shadows for a specific camera?</p>
http://answers.unity3d.com/questions/3388/animation-crossfade-not-workingAnimation CrossFade not workingPeter B-B2010-01-30T06:36:38Z2010-03-15T18:23:43Z
<p>I re-read the Character Animation guide and I simply fail to understand why my script isn't working!</p>
<p>Activate is called every frame when the mouse is down, and deactivate is called every frame when the mouse is up...</p>
<pre>function Activate() {
if (!animation.IsPlaying("activate"))
{
animation.CrossFade("activate");
}
triggerThis.Activate(); //a check to see if the function calls
}
function Deactivate() {
if (!animation.IsPlaying("deactivate"))
{
animation.CrossFade("deactivate");
}
triggerThis.Deactivate();
}</pre>
<p>Both "activate" and "deactivate" are animations in my Animation pane for the object.</p>
<pre>
Animations
Size: 2
Element 0:activate
Element 1:deactivate</pre>
<p>My script should theoretically check if its respective animation is playing. If it's not, play the animation. If it is playing, ignore it.</p>
<p>When I run the game, and click, the Activate script is run, but there's no animation!</p>
<p>Can anyone shed some light on this for me?</p>
<p>Thank you!</p>
http://answers.unity3d.com/questions/2807/simple-touch-command-on-iphoneSimple (?) touch-command on iPhoneDaniel2010-01-17T16:48:49Z2010-03-15T18:23:43Z
<p>Ive done the fps-tutorial a while back so I have some idea of how scripts work, but when it comes to the iphone-specific touchcommands Im a bit stumped.</p>
<p>Im simply trying to find a way to interact with the environment by clicking on various objects in the scene, and the first step in that process has been to try and figure out how this code-snippet retrieved from the docs works and how to implement it. Its supposed to just trigger a particle once the screen is touched, but I need it to do so only when the target object (lets say a cube) is touched.</p>
<p><hr /></p>
<pre><code>var particle : GameObject;
function Update () {
for (var touch : iPhoneTouch in iPhoneInput.touches) {
if (touch.phase == iPhoneTouchPhase.Began) {
// Construct a ray from the current touch coordinates
var ray = Camera.main.ScreenPointToRay (touch.position);
if (Physics.Raycast (ray)) {
// Create a particle if hit
Instantiate (particle, transform.position, transform.rotation);
}
}
}
</code></pre>
<h2> }</h2>
<p>This is how I think the script works:
In every frame a iPhoneTouch-object (touch) is created, which checks if the touch is a beginning touch. If so a ray is created from the camera to the touched position, and finally the particle-effect is triggered.</p>
<p>Is this correct, or have I misunderstood the function?</p>
<p>And if it is correct, how do I make it check if the ray has hit an object with a response? </p>
<p>And finally, where do I put this script? Should it be attached to each object that should respond to it (which would mean a lot of scripts running), or should it be attached to the player and have it check for each possible object the ray could hit with an if-else-structure?</p>
<p>Also, if you have a better codesnippet that incorporates not just one aspect that would be most welcome since codesnippets tend to be very illustrative and helpful in understanding concepts.</p>
<p>Thanks,
Daniel</p>
http://answers.unity3d.com/questions/5785/increase-range-of-pixel-lighting-on-terrainincrease range of pixel-lighting on terrain?pumuckli2010-03-15T16:19:29Z2010-03-15T17:48:51Z
<p>hi everybody, i've got a question:</p>
<p>If i render dynamic shawdows on a terrain with pixel lighting, unity will change to vertex lighting in a specific distance. Now my question: can i increase this distance, when it changes from pixel to vertex? </p>
<p>shadow distance in the quality-settings don't affect the shadows on the terrain...</p>
<p>Thank you!</p>
http://answers.unity3d.com/questions/5790/how-do-you-import-audio-assetshow do you import audio assets?Desso2010-03-15T17:37:55Z2010-03-15T17:37:55Z
<p>Every time I try to import an audio asset, I get the error 'file is not valid'</p>
<p>I even tried to save files in Ogg Vorbits and then bring them in, and when I check the Unity manual, it doesn't say any special orders for audio assets.</p>
http://answers.unity3d.com/questions/5675/getting-the-unity-editor-to-work-in-windows-7-64-bitGetting the Unity Editor to Work in Windows 7 64-BitJen Grier2010-03-13T21:05:05Z2010-03-15T17:28:44Z
<p>Unfortunately, I've just done the install of the Unity Editor on Windows 7 64-bit and can't get it to open. I've tried running it "as an Administrator" and in multiple compatibility modes, including XP and Vista options. No dice! Any help is appreciated.</p>
<p>I get this error:</p>
<pre><code>Problem signature:
Problem Event Name: APPCRASH
Application Name: Unity.exe
Application Version: 2.6.1.31223
Application Timestamp: 4b13e3a0
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdbdf
Exception Code: e06d7363
Exception Offset: 0000b727
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 236e
Additional Information 2: 236e213616a19c43b9b4f484bab02c9e
Additional Information 3: f0fb
Additional Information 4: f0fb81261199e5edc1200c7838f5a558
</code></pre>
<p>Thanks for the tips, but none of these suggestions have helped yet. I've tried:</p>
<ul>
<li>Disabling antivirus (Panda Cloud AV)</li>
<li>Multiple NVidia drivers</li>
<li>Installing in a new user profile</li>
<li>Making sure all Windows updates (optional as well) are installed, especially display drivers</li>
<li>I reinstalled IE8 through the Programs-Features>Add/Remove Windows Services, then reinstalled Unity. Rather than crashing, Unity seems to start, then silently refuse to boot. Period. No APPCRASH, but also no Editor! – Jen Grier 15 hours ago [delete this comment]</li>
<li>As a temporary workaround, I've tried running Unity on Virtual PC and VirtualBox with Windows XP installs, but VPC doesn't have 3D acceleration support (blasted!). VirtualBox DOES get Unity to open, but the windows/panels appear in flashing colors. I can navigate around the Island demo project, but it's not a workable scenario.</li>
</ul>
<p>If you have other suggestions, please post them! I've tried the first two given, but I haven't fixed this yet.</p>
http://answers.unity3d.com/questions/5788/using-wheel-collidersusing wheel colliders?JDubs2122010-03-15T17:19:20Z2010-03-15T17:19:20Z
<p>I'm trying to use a wheel collider in a school project and was wondering A)how to script it to work with Input.GetKey() with the up arrow increasing the motorTorque.B)will it react with the terrain object moving the bike forward??</p>
<p>Any answers would be appreciated.</p>
http://answers.unity3d.com/questions/4878/how-can-i-reference-a-prefab-from-a-gameobject-instance-of-itHow can I reference a prefab from a gameobject instance of it.Frankie Mac2010-03-01T03:10:44Z2010-03-15T16:35:54Z
<p>I have a script that finds a set of gameobjects in the scene and destroys them. (I do not know in advance which specific objects they are.) I then want to instantiate those objects after they have been destroyed. The references to the gameobjects are null (since they're destroyed) so I need to identify the prefabs they were based on.</p>
http://answers.unity3d.com/questions/5783/creating-window-on-mouse-actionCreating window on Mouse actionTobias2010-03-15T15:02:11Z2010-03-15T16:31:18Z
<p>Is there any Tutorial/Documentation on how to create window when clicking an object/npc, like a quest window?</p>
<p>I only found that one
<a href="http://unity3d.com/support/documentation/Manual/Game%20Interface%20Elements.html" rel="nofollow">http://unity3d.com/support/documentation/Manual/Game%20Interface%20Elements.html</a></p>
<p>But this doesnt help me.</p>
http://answers.unity3d.com/questions/5734/problem-rendering-a-textureProblem rendering a textureRana2010-03-14T20:50:52Z2010-03-15T16:27:44Z
<p>Hi, I'm newbie in unity and I'm getting problems when trying to render a plane with a texture over another plane.</p>
<p>I don't know what could be the problem, so I attach an image to show you the problem.
Some squares looks bad and other looks good.</p>
<p>The orange squares are a plane with a texture with transparent/diffuse shader. The position of that squares is a little upper than the big plane under (+0.001 on the Y axis).</p>
<p><img src="http://i4.photobucket.com/albums/y123/Cebollo/Imagen2.png" alt="alt text"></p>
<p>Thx, and sorry for my bad english.</p>
http://answers.unity3d.com/questions/5385/instantiate-a-gameobject-multiple-timesInstantiate a GameObject multiple timesKitty2010-03-09T14:43:47Z2010-03-15T16:17:55Z
<p>I have imported my Uuo element from 3ds Max. Now that I have done that I need to figure out the best way to go about to taking that GameObject and making it appear in multiple boxes with the color number of electron, protons, neutrons, and shells depending on whatever element is on the box.</p>
<p>I remember reading a little about instantiating a GO, but not sure if that would be the best way to approach this. If so, what else do I need to look for and figure out? If not, suggestions?</p>
<p>Any help/guidance would be wonderful for this little educational project of mine.....
Thanks.</p>
http://answers.unity3d.com/questions/4965/which-free-3d-modeler-to-use-for-creating-buildings-environmentWhich free 3d modeler to use for creating buildings / environment?profilespoppymyerscough2010-03-02T10:16:45Z2010-03-15T16:16:18Z
<p>I'd like to use Unity to create a web-browser accessible 'walkthrough' of existing buildings and gardens for my college, so no fancy gameplay needed, just a world with a lot of objects and decals. I don't have access to Maya or 3dsmax, so what is the best (free or cheap) tool for creating the environment? I've not tried Blender or Modo, though I have used Hammer (the half-life mod level builder) and that is great for large levels - I don't know if it's suitable for this. Any advice, what have other people been using?</p>
http://answers.unity3d.com/questions/5702/desktop-game-moreDesktop Game & MoreIain2010-03-14T08:45:24Z2010-03-15T14:54:42Z
<p>This could be a stupid question but with All the power that unity has is it possible to create a game/utility that would be able to run and make external commands to windows... ie shoot a crate and launch explorer... open a door launch an application.. then return to our game/utility afterwards?? Of course I am way out of my depth at creating such a venture anyway but I thought if I want to learn jump in at the deep end</p>
http://answers.unity3d.com/questions/5782/unity3d-remote-mac-helpUnity3D Remote + Mac helpAsheh2010-03-15T14:52:58Z2010-03-15T14:52:58Z
<p>Hey, having some trouble getting the Unity Remote working with my Mac. Ive had it working before but now Im not sure what ive done wrong:</p>
<p>1) Ive setup a network on my mac, lets say its called, "network1".</p>
<p>2) Iphone picked up that network and I connected to it via the iphone successfully.</p>
<p>3) I started up unity and also unityremote.xcodeproj built + ran the unity remote, it runs on my iphone fine but has "Searching for servies" under domain "local" and it sits and waits. Nothing appears.</p>
<p>What am I missing, anyone?</p>
<p>Thanks</p>
http://answers.unity3d.com/questions/5778/creating-levels-for-use-in-unityCreating levels for use in UnitySpikeX2010-03-15T14:38:03Z2010-03-15T14:49:59Z
<p>Kind of a braod question here...</p>
<p>What's the best way to go about creating a level for Unity? Making an outdoor level is easy enough (just use a terrain), but for indoor levels with various rooms, hallways, staircases, etc (think something like Unreal Tournament), how would one go about creating a level in Unity like that? I know Unity doesn't have a built-in level editor like a lot of other engines, so I'm just wondering what some of the best methods for building levels are.</p>
<p>(By the way, please don't read this in as a discussion question. It's not. I'm sure there is a right way and a wrong way, and I'm looking for straight answers, not opinions)</p>