Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Unity Tutorial: 3rd Person Vehicle, Steering with Mouse

  • Red Hen dev
  • 2019-01-27
  • 943
Unity Tutorial: 3rd Person Vehicle, Steering with Mouse
mousesteercontrolcontrolsunityunity3d3dscriptscriptscodecodingeasybeginnersimplequicktuthowtohow-tohow tovehicleshipspaceshipspacecraftyawpitch3rd personthirdpersonthrustmovemovementaccelerationspeedlookAttranslatequaternionlocalRotaterotation
  • ok logo

Скачать Unity Tutorial: 3rd Person Vehicle, Steering with Mouse бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Unity Tutorial: 3rd Person Vehicle, Steering with Mouse или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Unity Tutorial: 3rd Person Vehicle, Steering with Mouse бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Unity Tutorial: 3rd Person Vehicle, Steering with Mouse

A tutorial responding to James Hanvey's request -- how to steer a sphere using the mouse, with W for thrust, and with the camera following the sphere.

Apologies to James for almost immediately getting your name wrong: 'Harvey'. Sorry!

So, only two scripts needed. See below for the code :)

The steering setup will almost certainly need refactoring to deal with rotations messing up when pitch becomes too extreme: I will look for a clean solution!

Thanks for watching.

Code for the two scripts:

public class steerThrust : MonoBehaviour {

// Mouse direction (how much has mouse moved).
Vector2 mDir;

public float acc = 0.9f;

// Speed of vehicle.
float speed = 0f;

void Update () {
mouseSteer();
thrust ();
}

void thrust(){

// Pressed key?
// Increase speed.
if (Input.GetKey (KeyCode.W)) {
speed += acc;
}

// Translate by this transform's forward vector.
this.transform.Translate (this.transform.forward *
Time.deltaTime * speed);

// Deceleration/air friction.
speed *= 0.96f;
}

void mouseSteer(){
// What is the new mouse position on screen?
Vector2 mc = new Vector2(Input.GetAxisRaw("Mouse X"),
Input.GetAxisRaw("Mouse Y"));

// Add new movement to current mouse direction.
mDir += mc;

// Multiply both axes together and rotate this transform.
this.transform.localRotation =
Quaternion.AngleAxis (mDir.x, Vector3.up) *
Quaternion.AngleAxis (-mDir.y, Vector3.right);

}

}

***************
***************

public class CamFollow : MonoBehaviour {

// What shall we look at?
public Transform target;

void Update () {

// Look at target transform.
this.transform.LookAt (target.position);

// Set position to 10 units behind target.
this.transform.position = target.position +
(this.transform.forward * -10f);

}
}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]