how to color programatically created plane?
i have these lines to create a plane, and then i attempt to place a texture on it in game, and to change the color, but it stays dark grey even with blue texture on it. zfightingplane =...
View ArticleWhy is Vector3.Lerp slower than function Lerp (a,b,c):Vector3{...
When i was editing marching cubes, i found that Mathf.Lerp seemed a bit slower than a function of Lerp written in the same script as the marching cubes code. (Unless someone shows otherwise) Could you...
View ArticleSimple Voronoi Code not working
I tried to convert a fast voronoi code on [this page][1], I tried so many different combinations of code and there is always the same error, can anyone see what is wrong with my code? it looks like the...
View Articlemaxiumum instantiantions per frame?
instantiating is slow because it uses alot of memory for quaternions etc, it seems to slow frames very fast. (there is a way to instantiate raw mesh) A)What is the maximum instantiations per frame /...
View ArticleTerrainCollider.terrainData on custom mesh
Meshcolliders are slow, and updating them makes the game lag when an object has more than 1000 2000 vertices. So i would like to use TerrainCollider.terrainData on custom mesh, and i think only someone...
View Articlecan i use a hexagon mesh on a Terrain?
can i change the mesh on a terrain object to have hexagon-triangle tiles? the tiles are already tileable on a terrain with normal mesh planes. Can i use 100 small terrain objects in a game of 100x100...
View ArticleNew vertex limit of 131000 vertices per mesh?
my procedural object adds vertices until it goes over 65k vertices, and i expect an error message at that stage, and the mesh to dissapear, but there is no error message and the mesh is visible with...
View ArticleLookRotation flipping 180 degrees through y axis
I have LookRotation to rotate some points as the move through space, and when it crosses the Y axis it rotates by 180 degrees, sometimes 120, so there is an error in the mesh. this is the rotation code...
View ArticleHow to prioritise quaternions over transforms?
I am confused about how to properly combine transform.position, transform.rotation, and quaternions so that they dont override one another. I have a spacecraft flying in a tube with: rotation around...
View ArticleRecommended max sphere colliders for smartphone?
What is the recommended maximum number of sphere colliders to be used in a game for release on the windows appstore? should i limit the game to 10, 50, or 100 sphere colliders, at 15fps physics time?
View ArticleSyntax Error "can't multiply System Type with Float"
i have a function pln(num:float): float{} ... bizarre error happening, because pln worked in the previous function, same lines, and it halts on error for identical lines in a similar function just...
View Articlehow to assign mesh.vertices ToList linq extension
this doesnt work: var mesh2 : Mesh = child.gameObject.GetComponent(MeshFilter).mesh; var vtxlist = new List.(); var vtx2 = mesh2.vertices; vtxlist = vtx2.ToList();...
View Articleproblem with loop and mesh values
Trying to delete n colored uvs and vertices from a mesh, but after 4 loops, it sais the index is out of range, even though it is counting down from top to bottom. ![alt text][1] i dont understand. var...
View Articleproblem with loop and mesh values
Trying to delete n colored uvs and vertices from a mesh, but after 4 loops, it sais the index is out of range, even though it is counting down from top to bottom. ![alt text][1] i dont understand. var...
View ArticleU3D version 4 optional function parameters in javascript and c#
Can someone please demonstrate the Unity3d optional function parameters? i.e. function human(name:string,required; age: int, optional; shoesize:float,optional; haircolor : Color : optional) ... is...
View ArticleAutomatic GUI generation systems?
HELLO! Complicated Topic Alert! :) I want to make 100ds of similar GUI boxes, each with 3-4 sliders and 2-3 text input boxes, in the same screen position, to adjust different functions. The functions...
View ArticleHow to use shader _SinTime?
_SinTime alledgedly supports various speeds of oscillation. how to specify which one is used? if i wanted to have an oscillation at 100 frames per second, i would have to use sin(_Time*100)? No...
View ArticleTesselation Shading only in U3d Professional?
It seems my tesselated sphere has still got shading from the base vertices prior to tesselation. Am i missing a unity pro feature? Do i have to construct new normals for the mesh somehow? ![alt...
View ArticleSurface Shader If Condition W = :( A == B ? V syntax
i found some strange syntax in a surface shader, but i can't find any documentation on what it is. can't i just write if... else in a void surf()? what is :(a==b ? syntax and where can i learn it?...
View ArticleFragment Bumpmap Shader Doesn't Work
There is some cool code on this page to render bumpmaps using CG code, except... it doesn't render anything when i add a bumpmap....
View ArticleSometimes Shader CG doesn't listen to if condition, Why?
i had an if condition which works, if (_Mode <= 3.0) { and if i do if (_Mode == 3.0 || _Mode == 4.0) { the shader compiles but doesnt execute the if condition, it only runs the rest of the code.
View ArticleFind a script by name and add it to gameObject?
to make it simpler, i want users to be able to use one script, and that script loads a mouseOrbit onto the camera when a button is pressed, and unloads it when it's pressed again. can i do "if button...
View ArticleSelf Illumination shader without Ambient Lighting?
How can i take out ambien lighting from the standard unity shader? The object changes color as the light rotates and i would like a static color. I'd love some help for resources/ examples. Shader...
View ArticleCan i use ReadAllBytes instead of GetPixels?
I am creating a texture editor for many textures, and i wish to read them without setting all the textures to IsReadeable. Can i get a color Vector[4] using ReadAllBytes instead of GetPixels?
View ArticleAddComponent can't find script name MouseOrbit?
i moved a folder with 2 .JS from angry bots demo to character customization demo. the scripts are CameraScript and MouseOrbit. in Angry Bots, no errors, and in Character Customization unity demo, i get...
View Articlecode to access submesh materials 1,2,3,4 etc?
A woman has various submeshes to make her eyes, hair, etc. i can only select the entire woman, and all the materials are on her GameObject, and i would like to know how to access her different...
View ArticleGetAssetPath(texture1.instance)?
is it possible to find the path of a texture, using a gameObject that has an instance of that texture on it?
View Article.Net Error: System.IO.Directory.GetDirectories($, $, searchoption);
in .JS I try to get string and string[] using GetDirectories, var path1 : String[] = System.IO.Directory.GetDirectories(Application.dataPath, title, System.IO.SearchOption.AllDirectories); i have this...
View Articlefind type of asset by path? (to check if file is Texture2D?)
GetFiles returns a list of strings[] of asset paths, and i have girl_hair.tga.meta, i wish to check if an asset is a texture at given path prior to loading it to a tex2d. how can i?
View Articlehow to convert absolute path to relative Application.DataPath
GetFiles function returns this path: **E:/Users/Tuone/Downloads/CharacterCustomization/CharacterCustomization/Assets\DressingroomExample\dressing_room\textures\floor_wood.tga** how do i convert it to...
View Article