Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Как сделать что бы при прыжке объект поворачивался на 90 градусов? на юнити 3д

makssem Ученик (162), на голосовании 6 месяцев назад
Вот скрипт;
 using System.Collections;  
using System.Collections.Generic;
using UnityEngine;

public class PlayerJump : MonoBehaviour
{
public Vector3 jump;
public float jumpForce = 4.0f;
public bool isGrounded;
Rigidbody rb;

void Start()
{
rb = GetComponent();
jump = new Vector3(0.0f, 4.0f, 0.0f);

}
void OnCollisionStay()
{
isGrounded = true;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
{
rb.AddForce(jump * jumpForce, ForceMode.Impulse);
isGrounded = false;

}
}
}
Голосование за лучший ответ
IBM СОВМЕСТИМЫЙ Мастер (1393) 7 месяцев назад
 using System.Collections;   
using System.Collections.Generic;
using UnityEngine;

public class PlayerJump : MonoBehaviour
{
public Vector3 jump;
public float jumpForce = 4.0f;
public bool isGrounded;
Rigidbody rb;

void Start()
{
rb = GetComponent();
jump = new Vector3(0.0f, 4.0f, 0.0f);

}
void OnCollisionStay()
{
isGrounded = true;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
{
rb.AddForce(jump * jumpForce, ForceMode.Impulse);
isGrounded = false;

}
}
}
makssemУченик (162) 7 месяцев назад
?
makssem Ученик (162) makssem, смс
Похожие вопросы