- Home /
Duplicate of http://answers.unity3d.com/questions/130516/rotate-around-character.html
rotate around character
I'm trying to rotate the camera around the player character but when i use the if statement to see if the left or right arrows (Input name "Fire1") unity tells me that it cant convert an int to a bool. here's the code.
if(Input.("Fire1"))
{
transform.RotateAround(Vector3.forward * Time.deltaTime * 100);
}
@aldonaletto: Why do you close the question but then give no reason?
Why does this horrid website allow one user to close a question, and without a reason, at that? Anyway, your first line is incomplete. Go look at the Input page in the scripting reference for what methods exist in the class.
Guess I'll re-open this question since it seems there was no good reason to close it. @$$anonymous$$eater6 it's not aldonaletto's fault that there was no reason given, when you close a question it makes you think you give a reason when you pick one of the default ones, but it shows none.
Hey, guys, this question was posted twice by the same guy; I just closed one of them, and answered the other (by the way, I've just edited it right now). And I choosed the default reason DUPLICATED QUESTION; is it not appearing? Couldn't you guys see the question I left where it was being edited? Strange things are happening in this new UA...
@aldonaletto when closing a question the default reason will not show up on the new UA. You'll have to actually type it out yourself. I guess you were right to lock it though.
Answer by LegionIsTaken · Jun 15, 2011 at 09:17 PM
You cannot do what you just did.
function Update ()
{
if(Input.GetButton("Fire1"))
{
transform.RotateAround(Vector3.forward * Time.deltaTime * 100);
}
}
You have to specify what you are dealing with. Is it a button?(Input.GetButton(Down)) or a key(Input.GetKey(Down)) or a axis? When scripting you have to be specific it only dose what you tell it to do. It is like a dog, fun, cute and interesting, but persumably not the sharpest knife in the world.