Unity C# How to rotate an object using key press

Unity C# How to rotate an object using key press

Design and Deploy

8 лет назад

43,423 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@PaulJonesy
@PaulJonesy - 22.01.2023 15:07

Why not attach the script to the player and use the transform directly? Calling GetComponent in the update is very inefficient. If you do need to do something like this, cache it in the Start() by assigning it to a local variable;

Ответить
@lazikbro12
@lazikbro12 - 22.12.2022 20:44

can u make it animated?

Ответить
@lapiseqreal
@lapiseqreal - 27.08.2022 22:00

doesnt work for me, im getting errors saying 'Input' does not contain a definition for 'GetKeydown'

Ответить
@iankeith4055
@iankeith4055 - 02.08.2022 22:56

thx u save me

Ответить
@ItsTeaTimeCommentary
@ItsTeaTimeCommentary - 23.01.2022 11:23

Thank you! This is exactly what I was looking for.

Ответить
@michaelh2126
@michaelh2126 - 13.01.2022 00:00

You may have just saved me from failing college! Thank you!!!1

Ответить
@befree9390
@befree9390 - 04.10.2021 16:37

Thank you!

Ответить
@gabriel.cashez
@gabriel.cashez - 20.09.2021 01:36

I've spend my hole day trying to do this. thanks a lot dude

Ответить
@okng7857
@okng7857 - 29.06.2021 07:23

It took me a week to find this! It seems so simple yet I couldn't find it anywhere else. Thank you

Ответить
@scut_it_out
@scut_it_out - 08.07.2020 07:16

Thanks so much! and it still works in 2020!

Ответить
@filipkylberg8368
@filipkylberg8368 - 21.04.2020 13:24

still works 5 years later

Ответить
@laurentiu2559
@laurentiu2559 - 08.11.2019 00:22

Hi!
Can you help me doing the same thing using mobile touches? Thanks!

Ответить
@officialspock
@officialspock - 04.11.2019 13:41

Thanks man, you're a life saver

Ответить
@danielmoon5143
@danielmoon5143 - 24.08.2019 17:46

really thanks. Great job dude!!!

Ответить
@susanalopez3516
@susanalopez3516 - 23.06.2019 18:12

Great vid! But do you know how to activate the script when you get close to an object?

Ответить
@microman502
@microman502 - 30.05.2019 13:11

This tutorial still works to today (June 2019) but note that you can't smoothly rotate things.

Ответить
@Pyrowizurd
@Pyrowizurd - 24.05.2018 18:10

even if this video is not of great quality, it had the answer I was looking for. thank you.

Ответить
@kevo_codes
@kevo_codes - 20.05.2017 17:13

I was Searching for a solution for mapping keys, THANKS TO YOU, BRUH!

Ответить
@panisapengaem8977
@panisapengaem8977 - 14.12.2016 15:04

Thanks.
Can you help me?
i want to change using key press to button.
button click -> rotate change

Ответить
@drewhodges4294
@drewhodges4294 - 23.06.2016 11:53

Too small

Ответить