Quantcast
Channel: Answers by "nsxdavid"
Browsing latest articles
Browse All 93 View Live

Answer by nsxdavid

The code only checks if the distance to the player is

View Article



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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer by nsxdavid

Not possible.

View Article

Answer 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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer by nsxdavid

You might try thiis from the asset store (its free): https://www.assetstore.unity3d.com/#/content/1728

View Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer by nsxdavid

You are looking for something like: hit.point += hit.normal * 0.5f;

View Article

Answer 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 Article



Answer by nsxdavid

Confirming that Unity has eyes on this issue. Hope for resolution soon.

View Article
Browsing latest articles
Browse All 93 View Live




Latest Images