New Developer...i need help with this: How to make a Cube rotate by 90° to the left and right?

I watched several tutorials, used several scripts around the internet and this little motherfucker still gives me errors…basically, my idea is to move to the left and right my cube (the player) by 90° when you press the left and right keys…but i’m not good at all at coding, so i need help. Thanks in advance to who will help me :slight_smile:

yes, i alredy tagged the cube as player.

How to code this so?

Void Update()
{
Float horInput = Input.GetAxis(“Horizontal”);
Transform.Rotate(0, horInput * 10 * Time.deltatime, 0);
}

If you would like a better outcome, you might want to toss out the ‘I can figure this out on my own’ mindset and complete (not just view) several of the projects in the Learn section Unity provides for free. If you had, you probably wouldn’t have to have asked your question in the first place. There are no shortcuts, if you’re serious about learning follow the tuts available to you. A few months down the road with some perseverance and determination you can be doing some really cool stuff, all on your own.

1 Like

Yeah. Just get up on the giant’s shoulders.

Figuring out simple things is a waste of time. Let others show you all of the simple things, and then let them show you where the top dogs are today. Then, when you’ve easily been carried to the front of the pack, you can carry the baton even further.