Answer by nsxdavid
There are many ways to accomplish things like this, but this code will accomplish what you are after most closely aligned with your original approach: using UnityEngine; using System.Collections;...
View ArticleAnswer by nsxdavid
"I know that C# can only run on a Windows OS, and not in a web browser" Incorrect. Not sure where you get that from. Your Unity C# scripts will work the same on all supported platforms.
View ArticleAnswer by nsxdavid
You can measure accelerations, not absolute positions in 3D space. The [Input class][1] provides acceleration events and data. [1]: http://docs.unity3d.com/Documentation/ScriptReference/Input.html
View ArticleAnswer by nsxdavid
All child object's that have colliders report their collision events to the class wit hthe rigidbody. This is expected behavior. In this way you can create a complex collision shape from many child...
View ArticleAnswer by nsxdavid
You access a static variable in a class this way: {class name}.{static member name} So if this is the case: public class CreateFloorScript: MonoBehaviour { public static bool Winner = false; } Then you...
View ArticleAnswer by nsxdavid
![alt text][1] [1]: http://content.screencast.com/users/nsxdavid/folders/Jing/media/df6aab73-17a9-443c-ab98-8cfde8465261/2013-03-18_0059.png
View ArticleAnswer by nsxdavid
A proper decal system will batch all of the mesh triangles for optimal performance. A single particle particle system would be the most inefficient way of doing this. Consider:...
View ArticleAnswer by nsxdavid
The basic answer for how to keep someone from editing your data files "easily" is to encrypt the file. Roll your own or use the built-in capabilities. If you want a light-weight embeded database that...
View ArticleAnswer by nsxdavid
You can probably find what you want, or close enough so that you can get there, from the [Chickens Shader Bundle][1]. [1]: http://forum.unity3d.com/threads/98400-Chickens-Shader-Bundle
View ArticleAnswer by nsxdavid
Anything is prone to tampering. But since you need to somehow persist a purchase, presumably (i.e. write the value to disk somehow), that is usually the thing that gets tampered with. Encrypt such...
View ArticleAnswer by nsxdavid
The Shader used by the material doesn't have a property named _Color. Edit the shader to see how it works and what the internal property names are. They might have a color property but named it...
View ArticleAnswer by nsxdavid
I presume you mean the Mesh Collider has no mesh, but the object does. In that case drag the Mesh object from the Project into the Mesh collider's Mesh property. You can also hit the little target to...
View ArticleAnswer by nsxdavid
You might try thiis from the asset store (its free): https://www.assetstore.unity3d.com/#/content/1728
View ArticleAnswer by nsxdavid
That's scientific notation, which float values will sometimes show that way. 5.960464E-08 is pretty much zero, as in .00000005960464. Float values have precision limitations and Euler angles are...
View ArticleAnswer by nsxdavid
Assuming you have some custom behavior (aka a component script) that represents the creep, then you can have an array of that component. But each component knows what GameObject it is from and what...
View ArticleAnswer by nsxdavid
In addition to just using an Animation clip, you can also use an Animation Curve. This is one of the more powerful features of Unity that few people think to use. Create a public member of type...
View ArticleAnswer by nsxdavid
JavaScript and C# have difficulty talking to each other because of the order of compilation. Opinion: Use C# please. UnityScript is the devil. More detail:...
View ArticleAnswer by nsxdavid
Well that's because that's what you are telling it to do. Presumably what you intend to do is add the PlayerStats component to a GameObject in a scene. Now you have an instance to keep track of the XP....
View ArticleAnswer by nsxdavid
Your question is not very clear, but you are doing what you need to do as far as I understand what you are saying. In any function in Script A you can use the mechanism you wrote to get access to the...
View ArticleAnswer by nsxdavid
Every frame compare the angle of the light to the player. If the delta is within the spot light's angle, he's within the light code (not taking into account obstructions of course). To deal with...
View ArticleAnswer by nsxdavid
You need to be more specific about what is wrong. I can only presume you intend for Damage() to be called from another script. And then it applies the damage the Zombie's update. If so the problem is...
View ArticleAnswer by nsxdavid
When you switch your build type to iOS then you can set the Game View to be various iOS-specific aspect ratios from the dropdown menu just under the tab. Select iOS in the Build Settings dialog and hit...
View ArticleAnswer by nsxdavid
The Unity implementation of Vector3 == already accounts for "approximately equal". The documentaiton states:> This will also return true for vectors that are really close to being equal. Further,...
View ArticleAnswer by nsxdavid
Yes. But you probably don't need to in your case. You can make a prefab out of a hierarchy of gameobjects, which is what I think you are describing.
View ArticleAnswer by nsxdavid
Easy, you cache it yourself: Create a variable on your class to hold a reference to the component and do the GetComponent once in your start method and use that variable everywhere else in your class.
View ArticleAnswer by nsxdavid
I've seen them say that they simply don't support alpha... that the alpha channel is being reserved for some future feature. Which is ridiculous. Alpha already has a purpose... ALPHA! This decision...
View ArticleAnswer by nsxdavid
Confirming that Unity has eyes on this issue. Hope for resolution soon.
View Article
More Pages to Explore .....