Quantcast
Channel: Answers by "awest"
Browsing latest articles
Browse All 84 View Live

Answer by awest

I think your issue is with the transform.Translate function. I'm not sure what SpeedMultiplierBank is, but you are also moving it on the other axis by its own position. If you don't want it to move on...

View Article



Answer by awest

You can stop the colliders from blocking flares by moving the flare to the TransparentFx layer. If that isn't an option for some reason, one solution would be to compare the distance between two...

View Article

Answer by awest

To use only 2 axis, you can set up the Vector3 variables with one axis as the others y. Then MoveTowards that. var Vect3 = Vector3(wolf.transform.position.x, characterPlayer.transform.position.y,...

View Article

Answer by awest

You can set a fixed ratio. [Controlling Aspect Ratio in Unity][1] [1]: http://gamedesigntheory.blogspot.ie/2010/09/controlling-aspect-ratio-in-unity.html

View Article

Answer by awest

I can confirm that both scripts have no errors. I have tested them by themselves with only the necessary objects and they functioned as expected. So it must be something in the way the scene is setup....

View Article


Answer by awest

Does the character operate in this way throughout the game? If that is the case, I would ditch the animation and store the frames as a texture array. Then switch the texture to the next one in the...

View Article

Answer by awest

Do you mean Unity 4.3.4? If not you should probably upgrade once more. You can always stop the animation at the start by disabling the component or call `animation.Stop("animation-name");` Or, you can...

View Article

Answer by awest

Do you need to store the values for later? If not I would move them into the for loop so it re-sets it each time. for(var i : int = 0; i

View Article


Answer by awest

I would try checking if the players velocity.y > 0. then make it's collider a trigger. In C#, it could be one line in the players update. although you might only want to check when the player is not...

View Article


Answer by awest

I don't believe editor scripts can be attached to an object. They just go in a folder named Editor to be read as such.

View Article

Answer by awest

The short answer is yes. It's called [Polymorphism][1]. You can make a generic list in the base class and assign objects that inherit that base class within the list. [1]:...

View Article

Answer by awest

I see a couple issues. You are calling GameObject.Find every single frame (this is very slow and will cause lag in larger projects) and I don't see where you set attach_weapon to true or false. I would...

View Article

Answer by awest

The Url syntax would look like this www.website/script.php?formfield1=value1&formfield2=value2 The "?" starts the string and variables are separated with "&"

View Article


Answer by awest

I think the problem you're running into is that the Regeneration function is being called each frame for 10 seconds before health reaches over 100. You can use the return command to exit a function (to...

View Article

Answer by awest

The problem is that the GUIText variable will only accept GUIText. You need to change the variable type definition to be that of the text. That's just Text instead of GUIText. public Text scoreText;...

View Article


Answer by awest

Making indie water translucent is just changing one line of code in the shader. (I can't recall which one, but you can probably search the googs to find it.) Fog can be accessed and changed through...

View Article

Answer by awest

Thanks @NoseKills @KayelGee. I had to go to work. Glad you were able to see it through. The problem was this line because it added a clamped value to an unrestricted variable....

View Article


Answer by awest

In the line Quaternion.Lerp(qStart,qEnd,(MathF.Sin(Time.time*speed)+1.0f)/2.0f) qStart and qEnd are your beginning and end angles. The rest is how it calculates where it is between them. You should be...

View Article

Answer by awest

Sorry for reviving the old post, but I found this while searching for this exact solution. Eventually I found this tutorial and it answered all my questions....

View Article

Answer by awest

Instantiating objects with tags/textures is just a matter of creating prefabs. You could even have each object hold a reference to it's mini version, but that isn't the best way to make a radar. I...

View Article

Answer by awest

I start tackling that problem by taking vector points every so often from when the touch starts to when the touch ends. You could use [Camera.ScreenPointToRay][1] and [LineRenderer][2]. Those can give...

View Article


Answer by awest

To create an empty GameObject you can use GameObject parentObject = new GameObject(); //create an 'empty' object object.name = "BlockRow"; //set it's name To Parent objects just use their transform...

View Article


Answer by awest

Unity does compiles everything for you. In the file menu is an option "Build Settings" from there you can select the operating system and scenes. Click build and it will make the exe file and data...

View Article

Answer by awest

You should use exit time. In the animator is a default variable when setting up transitions. in the transition just leave it as exit time = 0.9 (90% finished) and add any other if statements onto that....

View Article

Answer by awest

You could use one [raycast][1] from the enemy pointed down and forwards a short distance. If it doesn't return something tagged as ground, turn around. I have also used empty [box colliders][2] set as...

View Article


Answer by awest

Typically a checkpoint does reset the puzzles and monsters prior to that point. It uses an object with [Don'tDestroyOnLoad][1] to save a couple variables like position, point, lives, etc. That would...

View Article

Answer by awest

You are starting your Coroutine every frame that your lives are 0 and respawn is true, but you don't set respawn to false for after 4 seconds. The method starts every frame for those 4 seconds. It...

View Article

Answer by awest

You can store initial values for the player. And use them to 'reset' the object when the time comes. You can subtract health using [OnCollisionEnter][1] or [OnTriggerEnter][2] if you don't already have...

View Article
Browsing latest articles
Browse All 84 View Live




Latest Images