javascript, default object comparator
i have a simple buff class and a generic list full of buffs. and i need to sort them but the [reference for the list's sort function][1] says: "Sorts the elements in the entire List using the default...
View ArticleEmit Random Particles?
I have a particle system that doesn't emit anything, i only use it's emit() function at specific times to get bursts of particles. Is there any way to have it choose randomly between two different...
View Articley and z rotation axis doing the same thing when x is 270 degrees
this has got to be the most annoying thing ever.... when the x axis rotates towards perpendicular with 0 degrees, the y and z axis become more and more similar until they do the same exact rotation...
View Articleraycast not detecting my mesh from blender
long story short, i imported a multipart mesh as a .blend file, i gave all its parts a rigidbody, mesh collider(convex), and a fixed joint to connect them all together. each individual peice is set to...
View Articleparticle system stops normal emissions after .emit() is called
i have a particle system with an emission rate set to 3, its works up until i call its emit function with 25 particles. then it just stops, and nothing will turn its normal 3 emission back on except...
View Articletrouble getting all children into an array.
I'm trying to get all the children of an object into a Transform[] variable like so: #pragma strict var tiles:Transform[]; function Start () { tiles = gameObject.GetComponentsInChildren(Transform) as...
View Articlemoving a transform by 10 but it goes exra...
this has me totaly stumped. im telling my camera to move down 10 like so: function initCam() { cam.transform.position.y = -10; } and for some reason when i test the app it goes from 0(its starting Y...
View Articlehealth bar position formula
I need a formula to position my health bar object as it scales down. i got close but i just couldn't get it right. i scale it down like so: transform.localScale.x = (maxSize*HP)/maxHP; Then on my next...
View Articlecannot access RectTransform variables from a script
how do i manipulate a RectTransform's variables from a script? variables like the height, right padding, left padding. when i try to change its height i just get an error saying height isn't a member...
View Articleparticle array null refrence
I'm just messing around trying to add some external effects to my particles(particle attraction in this case). but it seems my particle array isn't being filled, or something is going wrong when i try...
View Articlemoving a disabled particle system that's set to distance emission
no matter how hard i disable this particle system it still emits particles in a line when i move its transform. heres my code: function load() { boltParticles.emissionRate=0; // try to stop it from...
View Articleimporting google play game services with javascript
iv been following this video tutorial: https://www.youtube.com/watch?v=XmHXl-UFTqM iv followed it to the letter up until 12:21 and everything works nice when i follow his instructions with a C# script,...
View Articledetecting when admob interstitial ads are closed
Is there some function being called when the ad closes that i don't know about? for instance: when my users close the ad i need them to go to another page, where would i put that code to switch pages?
View Articlegoogle play services: picking a random user?
is there a way, using google play services, to pick 1 random user of the app; based on a given area (in my case the entire united states). and maybe put some filters on, like, people who agreed to...
View ArticleUI elements not animating colors
I have some UI elements in my scene (a couple UI.Texts and a UI.Image). they are all controlled by one animation, they have keyframes for movement, and color changes. They move as intended, but, their...
View Articleusing array functions on a string?
is there a way to use the array functions on a string, such as push, pop, shift, and all that? i tried to convert from string to char[] but it that doesnt work. i'm making a text adventure styled game...
View Articleoptimizing a forest.
So i'm trying to make a forest and iv been looking into combining the various tree meshes into one, but then i heard someone say something like: once they are combined, they will all want to render...
View Articlerich text issue
i'm working with a UI.text element and i have the rich text checked, but i'm using a little function that types out strings character by character with a little pause inbetween. I wanted to color code...
View ArticlenavMeshAgent with rigibody (non-kinematic)
I have some basic cubes walking across a navmesh with navMeshAgents but they also have rigidbodies because i want them to be able to be pushed, or tossed around, then get their bearings and continue...
View ArticleIK aimer (imported from blender)
i made a pretty simple turret in blender, and it aims just fine in blender using an IK constraint. but once i import it into unity it doesn't aim when i move around the IK target. is there some setting...
View Articleaiming a transform on one axis.
this is a recurring mechanic for me, whats a good, fast way to aim at something along only one axis? as for right now i just use transform.LookAt() then zero out the 2 unused axis. this seems like a...
View Articleinput keeps resetting.
every time i close, then reopen my project, all of the custom input buttons i created in the input manager are gone. i did save before i restarted it, so i don't see why its doing this.
View Articlehow to make the cursor ACTUALLY lock
no cursor locking iv ever tried, or cursor visibility has ever done anything for me.. do they just not work when i'm running the game through unity, do they only work on full builds? cursor visibility...
View Articleanimation window, yellow text after moving Animation component
after moving my animation component for my character from his hands(don't ask, i don't know why i put it there) to the top of his hierarchy, all the animations have missing properties. they are all...
View Articlesize of a spherecast?
is a SphereCast's radius the same as a sphere collider's radius, if it where on a object with (1,1,1) scale? just trying to understand sphereCasts a little better, since there's no Debug.DrawSphereCast...
View Articlearray resetting after enabling a disabled gameobject
my bow script has an array of arrows with length of 3, the bow starts disabled; then when i enable it the array is length 0. i even have this line in Start(): arrows = new Rigidbody[3]; and arrows...
View Articlewhy do complex objects made from many rigidbodys jointed together explode on...
example: right now i have a big ol tree, 16 segments all connected to end to end in a line sometimes when i fell the tree when it hits the terrain collider it just explodes like crazy and the various...
View Articlesetup grid layout group to expand from the center
is it possible to set a grid layout group to expand from the center, so when i add to the group it will expand left AND right / up AND down, instead of just expanding left OR right / up OR down? i mean...
View ArticleDictionary.TryGetValue for js
I'm trying to use a dictionary's TryGetValue in js, but i would need to pass a variable by reference. though it seems js cant use 'ref' or 'out' to pass by reference. line in questions is like this:...
View Articleobject can't be null when highlighted in the inspector?
Long story short: I have an inventory system that works fine, until I highlight one of the slots in the inspector during run-time, thus, exposing the 'item' object in the inspector. My code checks for,...
View Article