Hi, im trying to have a rotation of my characters pelvis so that when i hit (“d”) the hips rotate 90* right.
this is my script, and i don’t know whats wrong with it.
function Update () {
if (Input.GetKeyDown (“W”))
(Vector3.forward *90);
Hi, im trying to have a rotation of my characters pelvis so that when i hit (“d”) the hips rotate 90* right.
this is my script, and i don’t know whats wrong with it.
function Update () {
if (Input.GetKeyDown (“W”))
(Vector3.forward *90);
In your script you try to rotate by multiplying a value by a value, you aren’t calling a method or changing a value just doing some math and ignoring the result;
You can use the Rotate
method of the current transform
to rotate an object.
to rotate to the right or left you would need to rotate around the y
axis or Vector3.up
(imaging sticking a pole through the object and spinning it around the pole. that pole has to be going up and down for the object to spin left and right)
so you would do something like
transform.Rotate(0, 90, 0);
That crashed unity -_-