x


[Closed] 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);
        }
more ▼

asked Jun 15 '11 at 05:42 PM

rolltide1098 gravatar image

rolltide1098
1 3 3 3

@aldonaletto: Why do you close the question but then give no reason?

Jun 15 '11 at 08:56 PM Meater6

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.

Jun 15 '11 at 09:01 PM Jessy

Guess I'll re-open this question since it seems there was no good reason to close it. @Meater6 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.

Jun 15 '11 at 09:06 PM Joshua

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...

Jun 15 '11 at 09:30 PM aldonaletto

@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.

Jun 15 '11 at 09:34 PM Joshua
(comments are locked)
10|3000 characters needed characters left

The question has been closed Jun 15 '11 at 09:37 PM by Joshua for the following reason:

Duplicate of http://answers.unity3d.com/questions/130516/rotate-around-character.html


1 answer: sort voted first

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.

more ▼

answered Jun 15 '11 at 09:17 PM

LegionIsTaken gravatar image

LegionIsTaken
452 24 30 34

(comments are locked)
10|3000 characters needed characters left

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2170
x1047
x725
x676
x87

asked: Jun 15 '11 at 05:42 PM

Seen: 1143 times

Last Updated: Jun 16 '11 at 12:25 AM