Answer by Narv
Is this 2d or 3d? also, place an collided in each key object and a script that on the update function checks the input.tocuhes. Then raycast on touch using camera.main.screenpointtoray and see what...
View ArticleAnswer by Narv
are you ever calling the HPLose function? I think you may be looking for the OnCollisionEnter(Collision col) method for what you're doing unless you are calling the HPLose function somewhere else you...
View ArticleAnswer by Narv
some sanity checks first: * does your rocket have a collision on it? box collider, sphere, etc? * you are using a variable called terraincollide but never set the value to true but then you are...
View ArticleAnswer by Narv
I assume you want the spotlight to follow your mouse cursor on the floor or ground, correct? if so, look up the function ScreenPointToRay() in Camera.. also Physics.Raycast. You will get a ray from...
View ArticleAnswer by Narv
for(float t = 0.0f; t < 1.0f; ) { t += Time.deltaTime; transform.position = Vector3.Lerp(orgPos, dstPos, t); transform.rotation = Quaternion.Slerp(orgRot, dstRot, t); yield return null; }
View ArticleAnswer by Narv
You could check the remaining distance to the path end using: http://docs.unity3d.com/Documentation/ScriptReference/NavMeshAgent-remainingDistance.html and then if it is within a certain threshold from...
View ArticleAnswer by Narv
you could also just set the gameobject to inactive. Will the user pass the object again in the future? (such as a wall obstacle) If so you could just keep a reference to that object and then move the...
View ArticleAnswer by Narv
by button do you mean the GUI.Button() function in the OnGUI() method? If so then you just wrap it in an if statement and inside the if statement you put the code to move your character. void OnGUI() {...
View ArticleAnswer by Narv
Is it because your if statement is outside of a function definition? or are you defining the function inside another function? can't really tell from what you posted, could be a couple different...
View ArticleAnswer by Narv
So the word "Destroy" is appearing in the log? is this when you shoot the walls or when you shoot anything else? Is the collider on the wall set to "trigger" by chance? does it have a rigidbody...
View ArticleAnswer by Narv
you could instantiate the mob and add it to the nearby npc list and set the active / inactive state of it which will in essence enable / disable the mesh renderer (since you kept saying graphically)....
View ArticleAnswer by Narv
Can't really see what's wrong with your code without your code being posted, however: Unity does not directly support threads. Everything must be called from the main thread. However, if you wish to...
View ArticleAnswer by Narv
Try adding a Debug.log of the values in the function too to make sure that the value 100 is being passed as value. and player health before and after the addition to see if it's adding properly.
View ArticleAnswer by Narv
Why not put an empty game object in the hierarchy for the prefabs at the left and right ends (or wherever you want them). Then snap those game objects together? Position of the left game object would...
View ArticleAnswer by Narv
try: playerCollide = GameObject.FindGameObjectWithTag(Tags.player2).GetCompnent();
View ArticleAnswer by Narv
I'm not sure I understand your issue because it seems to be correctly doing what you want... It is stuck on 15 in this case because you had max at 16 and min at 14 so your next guess would have put it...
View ArticleAnswer by Narv
I think you are not storing the data as you are intending. you have the line: int m_GVmoves = IDcount - mGHmoves - 1; int m_Gtotal = IDcount - 1; so you are actually making them local variables because...
View ArticleAnswer by Narv
Found this question that had the correct answer: http://answers.unity3d.com/questions/28109/how-to-turn-and-face-the-direction-im-moving-using.html
View ArticleAnswer by Narv
You pretty much said it yourself. Using the binaryformatter to serialize a Deck class that stores a List and the Card class is just a series of public variables. Make sure your classes use...
View Article