Quantcast
Channel: Latest Questions by jukke
Browsing all 69 articles
Browse latest View live

smooth movement when draging a GUI texture

What the code below basicly does is that when you click and hold anywhere on the screen and move the mouse in X, a GUI texture(guitex) is moving with the mouse. The script works but its a little bit...

View Article



reading the width of a GUItexture

Is it possible to read the width of a gui texture? tried something like this: guiTex.width...but that didnt work obviously also posted here:...

View Article

Cant animate a GUItexture on GetButton using Mathf.Lerp

The code below basicly animates a gui element from not being visible to translate upwards to the bottom of the screen. The problem is that the animation only seem to ocure while the button is held...

View Article

Problem getting the right result when combining two textures

I also posted this on the unity forum so I figured I could just post the link to the question here: http://forum.unity3d.com/threads/100291-Problem-getting-the-right-result-when-combining-two-textures

View Article

Getting weird results when subtracting two identical numbers

Getting weird results when subtracting one number with the same number. I thought I was gonna get 0 as the result but thats not the case. Could anyone look at the code below and please tell me whats...

View Article


lerp problem and trying to understand "return;"

While I hover over an collider. The camera moves in on the object but only while I keep my mouse over it. What I want is that I only have to click on the collider to get the camera to move towards it....

View Article

cant change transform.position.z on GUITexture

I need to change the z value on a GUITexture so it will stay on top of other guitextures. However ot does not seem to work. chaning guiTexture.pixelInset.x does work however so I dont really know what...

View Article

Help with hiding childs

The following code is working and is basically taken from the reference. But how would I write if I wanted every child to get;" guiTexture.enabled = false;"...I tried around a bit but I only get errors...

View Article


Best way to "highlight" an object on mouse over

Lets say I have like 25 different objects in the scene which are always visible for the camera with quite complex colliders. I then want to highlight whatever object im hovering hover(with the mouse)...

View Article


Render with replaced shaders and materials to a renderTexture

I have some objects with some fancy shaders. But then I would like to render thoes same objects with a different camera ( to a renderTexture ). But as the output for the renderTexture, I dont want the...

View Article

How do I fill a texture with one color?

How do I fill a texture with one color, like red for example. I tried this; var fillColor : Color = Color(1, 0.0, 0.0); tex2.SetPixels( fillColor, 0 ); tex2.Apply(); But that does obviously not work,...

View Article

Problem with the android emulator "Device hardware is not supported"

Hello! I just got unity running on my android phone which is pretty cool. But I didn't have much luck with the android emulator. I get the following error: Error building Player: UnityException: Device...

View Article

My drag camera script gets messed up when changing fingers. Please help!...

the following code translates a camera upp and down when draging up and down over the screen. It works but there is one problem, lets say I put one finger down for draging, then I put a second finger...

View Article


Smooth rotation when dragging on mobile(android)

Alright so this script basically rotates an object when dragging across the screen with one finger. I would like to make it more "smooth" thou. Ive been trying alot of diffrent things like lerp and...

View Article

Get all objects that intersects with a object

How do I know which objects are within the bounds of another object. They wont move so I guess onTrigger functions wont do it. I looked at "Intersects" but that only seems to work for one other bound...

View Article


How do I get the Mesh Filter name from instance?

How do I get the Mesh Filter name from instance? I got this code: var instance : GameObject = Instantiate(Resources.Load(targetModel)) as GameObject; And I would like to print the name of the mesh...

View Article

Print current Transform of an instance in the debug log

Why do these lines of code not print the actual position of the instance but only "UnityEngine.Transform"? and how do I get the result I want? var curTransform = instance.GetComponent(Transform);...

View Article


How to get material name from instance

Below are some code wich instanciates a model. Now I want the models material name to be printed in the Debug.Log. Ive tried a bit with instance.GetComponent but cant get it to work. Anyone know the...

View Article

Resources.Load texture problem in function Update

If I create an instance in "function Start" and give it a texture like below it works: function Start () { var instance : GameObject = Instantiate(Resources.Load("103")) as GameObject;...

View Article

Problem with destroying instanced objects

I want to instantiate an object and whenever I instantiates a new object I want objects who share the same tag with the new object to be destroyed. I got the following lines of code instance =...

View Article
Browsing all 69 articles
Browse latest View live




Latest Images