Уже пробовал использовать Transform.position += Direction * Speed * Time.deltaTime; вместо GetComponent().MovePosition(transform.position + Direction * Speed * Time.fixedDeltaTime);, пересобрал все значения свойства Collision Detection компонента RigidBody, попробовал GetComponent().AddForce();
Я даже поменял Time значения в настройках проекта.
Код: Выделить всё
using UnityEngine;
public class cubescript : MonoBehaviour
{
public Rigidbody rb;
public float speed = 0f;
Vector3 direction = Vector3.zero;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
speed = 1.5f;
rb = GetComponent();
direction = new Vector3(-1, 0, 1);
}
// Update is called once per frame
void Update()
{
GetComponent().MovePosition(transform.position + direction * speed * Time.fixedDeltaTime);
}
private void OnCollisionEnter(Collision collision)
{
direction = Vector3.Reflect(direction, collision.contacts[0].normal);
direction.y = 0;
}
}
Инспектор куба
сцена
Подробнее здесь: https://stackoverflow.com/questions/793 ... made-of-cu
Мобильная версия