Answer by Arshia001
You didn't explain about your scenario, so here are some general tips: 1. Use navmeshes and path-finding. Unity has a path subsystem you can use. It'll be the way to go for 3D games, specially if you...
View ArticleAnswer by Arshia001
Do it like this: function Update () { var distance = Vector3.Distance(gameObject.transform.position, Target.transform.position); if(distance > 2) { GetComponent.().Play("walk"); var Step = Speed *...
View ArticleAnswer by Arshia001
You'd have to make the UI screen-space. Then' you'd find where to draw the images using: var ScreenPosition = Camera.main.WorldToScreenPoint(transform.position) What this does is it converts a point in...
View ArticleAnswer by Arshia001
I'd put separate timers (logic, script, graphics, everything) into every scene. You could have a script with the express purpose of carrying information over to the next scene. Something like this:...
View ArticleAnswer by Arshia001
It really depends on how you want it to look. Your UI was obviously designed for portrait, so it can't be expected to work correctly with a landscape orientation. To keep the portrait UI in the middle...
View ArticleAnswer by Arshia001
Since it's such a small texture, What I did was to check whether the texture was more that 8 pixels wide or high. Anything smaller than 8x8 was an error. This may or may not be a plausible solution in...
View ArticleAnswer by Arshia001
Check the editor's console. It's probably a conditional compilation or API difference generating an error in your scripts. It may also be a plugin that you're using but doesn't include an Android...
View ArticleAnswer by Arshia001
Books + tutorials + experimentation is the magic formula for learning.
View ArticleAnswer by Arshia001
This has nothing to do with Unity. C# does not allow field initializers besides constants, constructors and static fields, because to access a non-static field (position in this case) you'd need the...
View ArticleAnswer by Arshia001
Your code isn't complete, so I can only guess: 1. Does your instantiated object contain only one mesh renderer? Is it located on the root GameObject, or is it further down the hierarchy? 2. Does the...
View ArticleAnswer by Arshia001
try gameObject.GetComponent().material.color EDIT: Given the edited post above, the things I'd check for would be: 1. Is the Renderer attached to the same GameObject the script is attached to, or is it...
View ArticleAnswer by Arshia001
You can't just set the position of the object to the position you get from the mouse. It's bound by physics, and if you move physics objects to places where they're not supposed to be, they'll try to...
View ArticleAnswer by Arshia001
You're raycsting thrice. You only need to do it once, and then you can cache the results. A raycast is a relatively costly operation to do more than once for no reason. Try: bool bHit =...
View ArticleAnswer by Arshia001
Try logging the position in OnEnable, see what you get. It's a generally bad idea to leave this kind of logic to events and transforms and the sort. You could make a function in your vehicle (say,...
View ArticleAnswer by Arshia001
To solve your Euler angle problems, you can use Mathf.LerpAngle which takes the jump from 360 to 0 into account. Also, the equivalent of (0,0,0) for rotation is Quaternion.identity, since quaternions...
View ArticleAnswer by Arshia001
You'll need the 32-bit version of Unity to make the plugin work. While 32-bit application can run on 64-bit systems, you can't load 32-bit DLL's from 64-bit applications and vice-versa. Vuforia is...
View ArticleAnswer by Arshia001
From your code, it looks like you're spawning the decal at the exact point of collision. This will cause depth-fighting issues. You'll need to offset the bullet holes or use a shader with no depth...
View ArticleAnswer by Arshia001
I found this question thought google, and since others might end up here as well, I'm going to share my solution to it (discovered though a sizeable amount of lost hair) even though the question is...
View ArticleAnswer by Arshia001
Well, the AR image processing code is very CPU-intensive. It's also a fact that most (if not all) recent octa-core processors have overheating issues. I don't think you can do anything about it.
View ArticleAnswer by Arshia001
I'm guessing the animator is somewhere down the hierarchy and GetComponent is failing to find it... Change your variable declarations to Animator BlahBlahAnim; Animator YadaYadaAnim; You can still drag...
View Article