New answers tagged unity
1
Well this can't be solved in a single rendering pass, you need to render your scene from another point of view (different camera) to a separate off-screen render buffer in a different pass and then convert this buffer into a texture and bind it to _CameraDepthTexture.
I don't know how this is done in unity, but practically speaking, you should create a new ...
0
You can do it, it is done most of the time when it comes to projects that need to use servers. Your game client can run on C# and UnityScript, while the server runs on Java. As Byte said, you need to compile it in different project files. "No JavascriptContents.cs"
You can go to http://www.3dbuzz.com/ they have a ton of tutorials. You need to pay for it, ...
1
If you want to use C# classes within UnityScript, you need to place the C# classes directly in the 'Standard Assets' folder.
Otherwise, due to the way that Unity compiles it's code, you cannot reference C# classes from UnityScript or vice versa. By placing them within the 'Standard Assets' folder, you ensure that those files are compiled first, and then the ...
1
I agree with Byte56 and, just as an improvement at his answer, I recommend to check the official Car Tutorial: it's a project containing both Unityscript and C# scripts.
1
You can mix Javascript and C# scripts in one project with Unity. They cannot be compiled into the same file, but the same project is fine. I believe the base project that you start with in Unity3D contains both Javascript and C# if you want an example.
0
It seems that it's a Matrix problem
o.interpolatedRay = mul(UNITY_MATRIX_MV, v.vertex);
1
The limit for a single map is 2000, you can merge them until your pc allows you. I have copied a fully painted terrain around 4048~ times and everything was working properly. The rendering view ends at 2km. The terrains area does't affect performance, the LOD does, grass etc.
Somebody has actually made a map which was the size of Alaska, was funny to watch ...
0
According to most of the threads on Unity Answers there is no effective limit. You're limited only by computer accuracy of floating points, memory and the amount of objects you can have. That being said - you should consider cunking your scenes up for the sake of organization. Maintaining one big scene might get really monstrous, really quickly.
2
If I have understood your question correctly, as units A and B start attacking each other, you want the camera to move to a target position with a certain elevation and at equal and set distances from both units, thus defining two possible targets, both at opposite sides of the plane defined by A, B and the up vector. You want to determine which side of that ...
0
Namespaces are like "virtual folders" where you put your classes in. Just in code. Like how Packages work in Java or AS3. Eventhough in those two languages they are explicitly structured in actual folders too. It prevents Class names to conflict with each other and it allows for vendors to be denoted.
For example:
com.paulsoft.game.MyObject;
Like ...
1
You're calling animation.Play with the wrong argument types.
http://docs.unity3d.com/Documentation/ScriptReference/Animation.Play.html
The second parameter is a PlayMode, not a WrapMode.
4
There are many more things to the game that will be taken care of by a game engine than just the management of meshes. Control input, sounds, lighting, GUI, meshes other than the terrain, camera, etc.
So the benefit of using an engine comes from all the other features it provides. If you're going to be writing a voxel engine anyway, might as well have ...
-2
Using a game engine will simplify your task significantly. If you want a tutorial go here: https://sites.google.com/site/letsmakeavoxelengine/
If you're worried about performance the dont use java.
Dont worry about performance at first. Just get something to work then you can worry about optimizing it.
2
I don't know if you guys are still trying to figure this out, but I had the same issue awhile back and solved it by only using a single point light per dueling torches.
Set your torches up with flame particle systems, and then set the point light at the center of the hallway between the two torches. The particle systems draw the eye away from the origin ...
0
If you want to stay in the "Unity state of mind" and keep your code platform independent (even if just so you can easily test on your desktop), I found the easiest way to handle gestures is using one of the gesture plugins.
I can recommend two:
TouchKit by Prime31 - free and open source
Input.Touches - available in the asset store, not free.
Also worth ...
2
I assume it's just using a checksum over the binary to determine whether there have been any modifications. I don't think it would verify/check any external resources. Have you tried some black box testing with it?
To say for sure you'd have to look into the source code, which again might be something people with the source code license might not be allowed ...
3
I don't have pretty much any experience with Unity, so this might not be the most efficient way to do it (and my coordinate calculation might actually be wrong). But it should give you some idea:
All you have to do is evaluate the color at different pixels/coordinates and blend them together, probably doing so based on their actual brightness.
For a simple ...
5
Unity compiles your app into a bunch of assembly code with a thin Objective-C layer around it for OS calls and such. Assuming you're not doing any plugin work (e.g. needing to call OS level features for things) you can publish your game without any working knowledge of Objective C. Even if you do need OS level features, there's usually a plugin available ...
5
I'm assuming you're using GUI.TextField?
It doesn't appear that there's a built-in way to restrict the text field's legal input set, however, you can achieve the validation behavior you want by writing a script:
public class LimitInput : MonoBehaviour {
public void OnGUI() {
text = GUI.TextField(..., text);
text = /* replace offending text here ...
2
From the sounds of it, you want to change the speed of any animation playing. So, essentially, you want to change the speed of all playable animations. The Animation class inherits from IEnumerable, so you can iterate through all clips via a foreach loop.
C#:
foreach (AnimationState state in animation) {
state.speed = 0.5F;
}
Unityscript (Pragma ...
1
It's a little tricky. It's pretty confusing if you have a solid background with the web platform, JavaScript and DOM Events in partcular, where most of the events are abstractized in closures for each control.
In Unity, the Events are fired globally on GUI. You must then check them, and act accordingly.
Theory
while the GUIWindow is drawn, listen for ...
0
You cant use Resources.Load without using a string, i dont think that Resources accept any overload arguments.
Have u tried to define a public variable (so you can assign your object via editor) and than use it instead of strings?
Something like:
using UnityEngine;
using System;
public class test : MonoBehaviour {
public TextAsset tx;
void ...
1
Have a value in the shader that specifies wetness. Smaller than 0 means air, greater than 1 means water, and in between means meniscus.
Here is some pseudo code:
vec2 uv2 = bigWaves(uv); // modify the texture coords to create a wavy water effect
float wetness = (uv2.y - 0.1) * 100;
if( wetness<0.0 )
{
gl_Fragment = texture2D(screen_texture,uv); // ...
4
First off: There is the unity scripting reference, it is the best tool when creating anything with Unity3d.
http://docs.unity3d.com/Documentation/ScriptReference/
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetKeyUp.html
For input keys read about the Input.GetKeyUp - Returns true during the frame the user releases the key ...
3
Floating point precision is all relative. The further away from the origin, the less absolute precision you have.
In unity's case, general best practices are to use 1 unit = 1 meter. Do you need your entities to be a million meters away from each other?
A common practice for games with huge worl'ds is to occasionally reset the player's and worlds ...
1
Can you use the AssetPostprocessor to change the import settings of the textures in that particular folder?
http://docs.unity3d.com/Documentation/ScriptReference/AssetPostprocessor.OnPreprocessTexture.html
http://docs.unity3d.com/Documentation/ScriptReference/TextureImporter.html
...
0
I imagine you're working with an ortographic camera. With them, the position of the elements work with the X and Y elements defining the position on screen and the Z element defining its depth.
Check this link on how to use DeltaPosition: Input.GetTouch
0
There is a skybox shader that blends between two sets of skybox textures. Think day and night cycle!
If you want to build or animate the skybox from script, use skyboxmaterial.SetFloat("_Blend", yourBlend) to change the blending; can also use SetTexture material functions to setup or change the textures.
Video tutorial about day/night cycle: ...
0
@Zurechtweiser
Going from what you wrote:
It's about procedural animations. For instance, I want to move a character from A to B. As soon as he is at B, he should rotate around 20°. Then he should wait for event z to happen.
It would be prudent to follow the Single Responsibility Principle. The principle states that a class, or in this case an object, ...
2
Apparently there is a driver bug in some PowerVR GPUs due to Unity caching the compiled shaders. Calling Handheld.ClearShaderCache() before a level is loaded (Awake/Start of any script) will fix this issue.
More info here.
1
Whether or not you take manual control of a given face's texture coordinates, it will have texture coordinates. Anyway "untextured" isn't transparent, it's the color of the material applied (perhaps a default grey or white.) So this is why as you've noticed it doesn't make faces transparent when you don't directly assign their texture coordinates.
The ...
1
You can use function CharacterController.Move to detect collision to the wall. if you don't want to use Move then you can cast a ray with Raycast to check if wall close enough to stop your character or let him move ;)
0
I fixed the same issue by changing the COM port to COM9 or less. If the COM port number is 10 or greater, it won't work.
0
This apparently has to do with how MipMaps are generated, though, in personal experiments I could not reproduce your problem to quite the magnitude you have. My best guess is that you got a double-threat going on: Unity may not be importing the mesh at a high enough resolution, and the gradient color you have going on there may be calling more attention to ...
9
While the aerodynamic effects caused by a fan can be quite complex to model accurately, it is sufficient for most cases to model the force it applies after the Inverse-Square Law.
It means that the force it applies to another object is divided by the distance multiplied with itself.
Another factor you could or could not model depending on how physically ...
1
You could simply calculate the distance ( you can use any mesh for collision clipping to represent the "air flow" limits), the closer it gets the higher the force you apply to it in that direction. Of course this isn't as accurate, but you could add noise to the direction of the velocity.
Top 50 recent answers are included

