Quantcast
Browsing all 90 articles
Browse latest View live

Answer by Kleptomaniac

Hey there, Although you have failed to present any code (which makes helping you that much harder) I can give you a generalised answer. All you need to do is base your GUI rendering on a boolean...

View Article


Answer by Kleptomaniac

This is not the correct way to format that conditional. Unless I'm mistaken, the only syntactically correct way to accomplish what you want is like this: if (Vector3.Distance(playerTransform.position,...

View Article


Answer by Kleptomaniac

Hey there, Not super sure what you're asking here, but I'll give it a crack. Do you just want to make it so you can open the gate with an arbitrary number of keys as opposed to just E? if...

View Article

Answer by Kleptomaniac

Hey, Having read your last comment, I believe I understand what you want now. Try using [Quaternion.Lerp][1]: float maxRot = 45.0f; //Max neg and pos strafe rotation value float rate = 2.0f; //Rate of...

View Article

Answer by Kleptomaniac

Hey there, You're going about this the wrong way. Instead of hard-coding your gun to follow the rotation of the camera, all you need to do is parent you gun GameObject to your camera. You can do this...

View Article


Answer by Kleptomaniac

Nobody here is giving you a clear answer. I would set out your script like so: #pragma strict var topdownCam : GameObject; private var cameraFollow: CameraFollow; private var planeSelfMove:...

View Article

Answer by Kleptomaniac

Ah, after reading your question a few more times, I think I've finally got it. The reason that this is happening is because you have *two* cameras, and you are changing the ShakeRotation on the camera...

View Article

Answer by Kleptomaniac

In order to randomly affect the x and y travel direction of your pellets, instead of having `Vector3(0, 0, speed) * Time.deltaTime`, try using [Random.Range][1]. So therefore:...

View Article


Answer by Kleptomaniac

This script is kind of a mess. Here is it cleaned up and optimised: //Got rid of ApplyDamage() here, because it seemed to bear no purpose var maxHealth : int = 100; //Typed these, as dynamic typing...

View Article


Answer by Kleptomaniac

I solved this a while ago by using LateUpdate() ... not sure if it is exactly a legitimate solution but it seems to work fine: function LateUpdate () { if (transform.rotation != Quaternion.Euler(0, 0,...

View Article

Answer by Kleptomaniac

The problem is that when you run you OnCollisionEnter() function, you call `Destroy(this.gameObject)` before you are even able to increment your score. This means it will not work as this script is...

View Article

Answer by Kleptomaniac

Do a tag check. For example: if (collision.gameObject.CompareTag("Target")) { Destroy(collision.gameObject); } This will only destroy objects tagged with the word "Target". Do the targets have a...

View Article

Answer by Kleptomaniac

I would suggest simply implementing a trigger collider for each section of the game in which you want to initiate dialogue. You can do this by simply setting up an empty GameObject with a Box Collider...

View Article


Answer by Kleptomaniac

You should really be using the [Event class][1] for event handling in OnGUI(), due to the fact that the OnGUI() function has multiple passes per frame and will thus repeat Input calls more times than...

View Article

Answer by Kleptomaniac

This means that an object reference had not been assigned to your orbs variable. Have you rechecked it in the Inspector to see that it hasn't lost your reference?

View Article


Answer by Kleptomaniac

Yes, that is because it is a component of your camera and is only rendered while your camera is active in game. Within your scene, you are using your scene camera. That is normal behaviour. If you'd...

View Article

Answer by Kleptomaniac

As long as when you build your game, in the Platform Settings, you use 'PC and Mac Standalone', then your game will be compatible with both Mac and Windows. Unity does everything for you. :) For more...

View Article


Answer by Kleptomaniac

As is said [here][1], it isn't possible to set the cursor position without external .dlls. Screen.lockCursor doesn't automatically set the position of the cursor to the centre of the screen, it only...

View Article

Answer by Kleptomaniac

I would suggest cleaning this up. As @IgnoranceIsBliss said, strings can already be accessed as arrays. Therefore you can eliminate your SplitString function. Also, I'm assuming that underScore is the...

View Article

Answer by Kleptomaniac

To determine the direction that your character is facing, try [Transform.forward][1]. To rotate an object based on the position of another gameObject, try [Transform.LookAt][2] like so:...

View Article
Browsing all 90 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>