Quantcast
Channel: Answers by "khenkel"
Browsing all 47 articles
Browse latest View live

Answer by khenkel

Try this site: http://www.cgtextures.com/ You have to register to get the high resolution ones, but it is free. Also check About -> License first.

View Article



Answer by khenkel

I can't spot any errors in your code right now so I suppose that your obstacleGenerator Start() doesn't get called at all. Maybe there's no instance of your object, or you're accessing the wrong object...

View Article

Answer by khenkel

Yes, either put it in the FixedUpdate(), OR only multiply with Time.deltaTime **where you are actually changing your object's position/rotation/scale**. In your case, remove it from the upper parts and...

View Article

Answer by khenkel

Try renaming the GameObject to something else, because "light" is already used. Every GameObject has a light variable by default (doesn't matter if it exists or not) and you're trying to access it....

View Article

Answer by khenkel

I would recommend to use particles for this. This actually requires a lot of particles, but Unity can handle them quite good. You can use the default (circular) sprite for this. Just give them a color...

View Article


Answer by khenkel

This is quite hard to achieve from scratch imo and unfortunately I can't provide a perfect solution. But I can give you some ideas about this: - This programmatic blending requires a custom shader. I...

View Article

Answer by khenkel

As a quick solution I would suggest setting a bool to true in the OnServerInitialized() and polling it in the OnGUI(). Something like this: bool serverInitialized = false; void OnServerInitialized() {...

View Article

Answer by khenkel

I haven't used this yet, but try out the OnBecameInvisible() method. Something like this: void OnBecameInvisible() { // Position change } See here for more info:...

View Article


Answer by khenkel

You need to modify the entire velocity variable. x, y and z are read-only. Nonetheless it is not recommended to modify the velocity variable. You should use Physics stuff instead, like AddForce()....

View Article


Answer by khenkel

There can be a few reasons why your Raycast "doesn't seem to work". I don't know what exactly doesn't work, so I'll provide some ideas: - First of all, Physics.Raycast returns a bool, so you might want...

View Article

Answer by khenkel

That's because you're using Time.deltaTime as the fraction parameter in Lerp(). This is NOT an actual time value but the time in seconds it took to complete the last frame. I didn't read up intensively...

View Article

Answer by khenkel

I think you might want to start with the Unity documentation: [GUI Basics Tutorial][1] [GUI.Button reference][2] I'm sorry for only providing links, but I think writing code for you or extensively...

View Article

Answer by khenkel

First of all you can write: if (DentroEscalerilla) { // Stuff } You don't need to double compare it with "== true". About your problem: How big is the cube? Does it fill the entire ladder "area"? If...

View Article


Answer by khenkel

Well, in general your player can collide with pretty much anything (not only bullets), so the best way is to only perform code on specific bullets. You have the Collision parameter for this. Something...

View Article

Answer by khenkel

Simple answer: Physics.Raycast() ITSELF is NOT related to the screen resolution. Better answer: Your problem is probably related to your "overray" Ray object (eg. when you're creating it via...

View Article


Answer by khenkel

I am sorry, but what full screen button do you mean?

View Article

Answer by khenkel

The type you're probably looking for here is AudioClip. **Play()** plays the stored AudioClip in your AudioSource. (assigned in the Inspector or via "audio.clip = myClip;") **PlayOneShot(AudioClip...

View Article


Answer by khenkel

I would recommend to separately compare the r, g, b and a variables (respectively only the ones you need). Also try printing the values of colour2 separately (eg. "print(colour2.r + ", " + colour2.g +...

View Article

Answer by khenkel

Use this: function Update() { if(Input.GetKeyDown(KeyCode.Alpha1)) { audio.mute = !audio.mute; } } It didn't recognize your "1" string. Also the muting is more clean now.

View Article

Answer by khenkel

UPDATE: Use this: private const float MOVEMENT_TIME = 2.0f; // The object moves for 2 seconds private const float MOVEMENT_DISTANCE = 10.0f; // Distance the object should move void Update() {...

View Article
Browsing all 47 articles
Browse latest View live




Latest Images