- Home /
How to Scaling object with new UI slider ?
i want to adjust scale of an object with new UI slider, how to do that ?
here my code .. i attach it to slider
using UnityEngine;
using System.Collections;
public class ScaleObject : MonoBehaviour {
public float _value = 1;
// Use this for initialization
void Start () {
}
// Update is called once per frame
public void OnSlide (GameObject _target) {
_target.transform.localScale = new Vector3 (1, 1, 1) * _value * Time.deltaTime;
}
}
Comment
Answer by sujit11dec · Mar 24, 2015 at 03:54 PM
Check this video...definitely tyou will get some idea.
http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-slider
can you give me some example code ? i dont understand at all
Your answer
Follow this Question
Related Questions
Why is my Unity script overwriting other game objects on which it is attached to? 1 Answer
How to get float value based on the element size? 0 Answers
problem with a list that has to store different things for multiple gameobjects 1 Answer
The Type Or Namespace UI could not be found - Trying to create a clickable button 2 Answers
How do you get Old OnGUI Scripts to work with the New UI Scrollbars? 0 Answers