This question might be Abit noobish but, is there i can store rotation angles like using vector3 for position. An example of what I want is like this
Vector3(x,y,z)
but for rotation
This question might be Abit noobish but, is there i can store rotation angles like using vector3 for position. An example of what I want is like this
Vector3(x,y,z)
but for rotation
Ceejay! you should know how to use the documentation now!
just go here
and find what you need.
In fact it is “eulerAngles”
For example, you could say
Debug.Log("the angle on the y axis is " + transform.eulerAngles.x );
Anything you need regarding Transform, go there and find it!
Later you can learn about Quaternions - but you’ll need to read unityGEMS.com
Cheers!
Hey Ceejay, re your further question …
Instantiate(create,
Vector3(
hit.collider.gameObject.Find("0").transform.position.x,
hit.collider.gameObject.Find("0").transform.position.y,
hit.collider.gameObject.Find("0").transform.position.z),
hit.collider.gameObject.Find("0").transform.rotation);
Basically try something like this …
var oldEulerAngles:Vector3;
oldEulerAngles = gameObject.Find("0").transform.eulerAngles;
now you can modify that, you understand? try this for example:
oldEulerAngles.x = oldEulerAngles.x + 25;
so after you have done that, try something like this:
var newObject:GameObject;
newObject = Instantiate( create );
newObject.transform.position = gameObject.Find("0").transform.position;
newObject.transform.eulerAngles = oldEulerAngles;
you understand that ??
Let us know if you need more help.
Read this one for many examples of how to Instantiate … cheers!