I want my object C(self) to go to object B.
this is my way of doing it:
public int speed = 5;
public Transform target;
public int strength = 1;
// Update is called once per frame
void Update ()
{
transform.Rotate(target.rotation.x,0,0);
transform.position+=new Vector3(0,0,1);
}
I am new to unity but according to my theory i will let ObjectC(self) rotate towards ObjectD and then go towards that direction.
but it is not working, if there is another easier way for it to be done pleas let me know.
Thank you in advanced.
You had the right idea. If your question is answered. Click on the checkmark next to the best answer to close it out.
– robertbu