- Home /
Question by
HWQLearner · Sep 08, 2015 at 08:53 AM ·
c#uislidertranslation
Why hip will move upward and downward automatically when start to drag slider at x,y and z axis?
Hi, I am beginner in UI slider Unity 5. I am facing the problem of hip position will move upward and backward when I just start to drag the slider. Code used:
public void OnDrag(PointerEventData data) { _translation.x = _sliderX.value; _translation.y = _sliderY.value; _translation.z = _sliderZ.value;
StartCoroutine (translation ());
}
IEnumerator translation()
{
Quaternion _rotation = Quaternion.Euler (_hipRotation.x,_hipRotation.y,_hipRotation.z);
Matrix4x4 _m = Matrix4x4.TRS (_translation,_rotation,_hipScale);
_newPos = _m.MultiplyPoint3x4 (_oriPos);
hip.gameObject.transform.position = _newPos;
yield return 0;
}
Hope someone can help me because I am facing this problem for many days already. Thank you.
original.png
(48.1 kB)
bug.png
(38.7 kB)
Comment
Your answer
Follow this Question
Related Questions
Lagging/unmoving slider 0 Answers
Use Slider for Geometry (GameObject) 'layers' 1 Answer
How to get an object to follow the Slider knob? 0 Answers
Slider moving on hover 0 Answers
Slider moving on hover 0 Answers