Quantcast
Channel: Answers by "Slev"
Browsing all 59 articles
Browse latest View live

Answer by Slev

The [Animation.IsPlaying][1] field sounds like just what you need! [1]: http://docs.unity3d.com/ScriptReference/Animation.IsPlaying.html

View Article



Answer by Slev

Probably not from C# itself. However, in Unity Pro you can use precompiled Binaries (DLLs) and since those can do those things, then technically yes, Unity could be made to do this using binaries. You...

View Article

Answer by Slev

You have a typo. It should be: var normalmotor : CharacterMotor = FirstPersonController.GetComponent(); You had an extra period between the function and the type directive.

View Article

Answer by Slev

Drag them above and below each other in the list of objects in the scene. The list of objects represents the layering to a degree.

View Article

Answer by Slev

I think you just have your ordering wrong. I think you just want: function Update() { if (moveforward) move(); else stop(); } function move() { if (tranform.position.x

View Article


Answer by Slev

The simple way would be to create a monitor script attached to an object in the level, or to the camera. Then we can use [FindGameObjectsWithTag][1] to count them i.e.: int enemy_count = 0; foreach...

View Article

Answer by Slev

Edit -> Preferences -> Skin Assuming you mean the editor skin and not something in game.

View Article

Answer by Slev

You just need to attach all the scripts to an Object and then call [DontDestroyOnLoad][1] this will ensure the object is carried with you. [1]:...

View Article


Answer by Slev

You're rotating around multiple axes. If I rotate 8 degrees y followed by 10 degrees x it's going to rotate based on my rotation positions after the 8 degrees y. The way I generally handle this is have...

View Article


Answer by Slev

Yes because each line is making a new text box. Instead what you want to do is something like: if (GUI.Button(Rect(10,500,50,50), "Click")) { num_boxes++; } And then use a loop or something to draw...

View Article

Answer by Slev

Ok based on the picture you're flipping the wrong piece of the vector. Try this: if (angle 90) transform.localScale = new Vector3(-0.6f, 0.6f, 0f); else transform.localScale = new Vector3(0.6f, 0.6f,...

View Article

Answer by Slev

Use both! With fast moving objects colliders will occasionally pass through each other. First step is to set your colliders to continuous detection that will catch more collisions. Secondly, if we...

View Article

Answer by Slev

Have you tried using the [Reference Resolution][1] component? That resizes while maintaining object aspect ratios. [1]: http://docs.unity3d.com/460/Documentation/Manual/script-ReferenceResolution.html

View Article


Answer by Slev

As long as you see the files on github/your preferred repo host, it's fine. Windows and Linux use different characters to ends lines. Windows uses CRLF which is Carriage Return Line Feed, where as...

View Article

Answer by Slev

All of these things can be done using solely the new UI system. However, a lot of the actual game backend would need real code. But every UI feature you described can be handled almost entirely without...

View Article


Answer by Slev

When Translating you need to use Time.deltaTime. This will switch your Translates to be frame-rate dependent and allow you to translate in time. For instance Translate(Vector3.forward *...

View Article

Answer by Slev

It sounds like you need to redefine how your code is structured. In pseudo code: Raycast verify we are allowed to plant. If yes, use HitInfo to get rotation and position of wall. Instantiate the object...

View Article


Answer by Slev

Similar to what Zodiarc said you can simply allow any Chunk to contain a reference to all adjacent chunks. Alternatively you could store every chunk inside of an n-nary tree structure. Both of these...

View Article

Answer by Slev

You may want to take a look at the [Screen.lockCursor][1] documentation. You want to add an extra boolean value or some other value as a way to make sure the cursor is locked or unlocked. The other...

View Article

Answer by Slev

It sounds like a logic error to me. We don't want to set the parent to null until we are sure we missed the next log. What I can see happening is you press forward, set the parent to null, then the log...

View Article
Browsing all 59 articles
Browse latest View live


Latest Images