This is the code that I have written to get an object rotation

The object’s X rotation is 45

But on the console I am getting 0.3826835
This is the code that I have written to get an object rotation

The object’s X rotation is 45

But on the console I am getting 0.3826835
c.transform.localRotation.eulerAngles.x
This isn't working for me, I am getting a value not even close to the actual in inspector during runtime. Any changes? Please help
– shinichikudo997i am rotating object between 50 to-50 and getting value far from actual value, what is am missing ?
– tysfgames[PROBLEM SOLVED]
.
Skip all the above coments.
.
I found a way to get the exact rotation values as in INSPECTOR
.
.
I am showing for angle (x)
,The code is as follow
.
public Transform GameObject;
void Update()
{
float Rotation;
if(GameObject.eulerAngles.x <= 180f)
{
Rotation = GameObject.eulerAngles.x;
}
else
{
Rotation = GameObject.eulerAngles.x - 360f;
}
}
Have you tried using Visual Scripting or Bolt? if you are new to coding these could help with learning what things do and not so much did i spell something wrong. you can also watch your script in action as it runs.
Well I was thinking of simple city with only one instance of basic building (stadium, theatre, hospital, police station, school, swimming pool, etc. + some residential and industrial areas). I have see that some packages can be bought from 100 to 2000 $ on various modelling sites. Couldn't it be within that range ?
– jml
In the code I have written local rotation but I want global rotation
– SimonClintonIvc.transform.location is a quaternion In theinspector, the rotation is shown in euler angles
– Hellium