Hi,
Sorry I have not properly explained the problem.
I’m making a game with a ball. It is handled with the arrows of the keyboard and the mouse for the view around the ball.
But there is a problem. I succeeded to do the movement of the ball and of the camera but no way to linked them.
I would like that when I turn the camera the “forward” of the ball turn itself. I so always go forward if I press the forward arrow (depending on the view of the camera), and if I push the back button I go back.
The mouvement is made thanks to forces (I have to keep the forces I need for the game).
Here the script for the mouvement of the ball :
var vitesseDeplacement = 8.0;
function Update () {
if (Input) {
rigidbody.AddForce(Input.GetAxis("Horizontal") * 25 * vitesseDeplacement * Time.deltaTime,0,Input.GetAxis("Vertical") * 25 * vitesseDeplacement * Time.deltaTime);
}
}
And here for the camera :
var sensibilite : int = 3;
function Update () {
transform.Rotate(0, Input.GetAxis ("Mouse X") * sensibilite, 0);
}
I surely checked the tutorial of the “Roll-a-Ball”, look at the script of character in Unity but I lose the forces with it. And check at Unity Manual and I didn’t found the correct command…
I hope you will help me,
Thanks for your answer,
IceBlackSanctum,