ооооо

This commit is contained in:
Enikeevtimur
2022-04-18 22:37:09 +07:00
parent d911dce62a
commit dfbdf7ad31
1505 changed files with 696529 additions and 513 deletions

View File

@ -0,0 +1,29 @@
using System;
using UnityEngine;
namespace UnityStandardAssets.Vehicles.Car
{
// this script is specific to the car supplied in the the assets
// it controls the suspension hub to make it move with the wheel are it goes over bumps
public class Suspension : MonoBehaviour
{
public GameObject wheel; // The wheel that the script needs to referencing to get the postion for the suspension
private Vector3 m_TargetOriginalPosition;
private Vector3 m_Origin;
private void Start()
{
m_TargetOriginalPosition = wheel.transform.localPosition;
m_Origin = transform.localPosition;
}
private void Update()
{
transform.localPosition = m_Origin + (wheel.transform.localPosition - m_TargetOriginalPosition);
}
}
}