A
A
ALTech12020-04-15 22:36:36
Unity
ALTech1, 2020-04-15 22:36:36

How to make an object move behind the Wheel Collider?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    public WheelCollider Right;
    public WheelCollider Left;
    public WheelCollider BackRight;
    public WheelCollider BackLeft;
    public float motor=100f;

    private void FixedUpdate()
    {
        Right.motorTorque = Input.GetAxis("Vertical") * motor;
        Left.motorTorque = Input.GetAxis("Vertical") * motor;
        BackRight.motorTorque = Input.GetAxis("Vertical") * motor;
        BackLeft.motorTorque = Input.GetAxis("Vertical") * motor;
    }
}

There is such a script that spins the Wheel Collider by pressing the buttons. And how to make the object move with the help of these colliders? Help me please!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question