I’m utilizing this code:
utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing UnityEngine;
public class HARcieveAngleChanger : MonoBehaviour
{
personal float ha;
personal float HAZ;
public ConfigurableJoint CJ;
public Vector3 newanchor;
public Vector3 newaxis;
public void OnValueChangedHA(float newValue)
{
ha = (HAGrab.HAUpdate);
UnityEngine.Debug.Log("ha WHAT YO DOING = " + ha);
HAZ =(float)0.8 * (Mathf.Tan(ha)) ;
UnityEngine.Debug.Log("HAZ WHAT YO DOING = " + HAZ);
remodel.place = new Vector3(0,0, HAZ);
newanchor.y = (float)-8;
newanchor.z = -HAZ;
newaxis.y = (float)8;
newaxis.z = HAZ;
CJ.connectedAnchor = newanchor;
CJ.secondaryAxis = newaxis;
}
}
From the debug.log(ha)
, I get 45 after I enter a forty five worth into the enter UI. The HAGrab
code will get this. Nevertheless, the worth outputted for HAZ
at all times comes out incorrect (i.e. utilizing trig TOA, tan(angle)*size
of alternate facet = reverse facet, with a forty five diploma angle it ought to come out as 0.8)…
Does anybody have any concepts for why that is the case?