- Home /
How to Impement Steering Wheel in SteamVR?
Hi everyone!
I want to implement possibility to control vehicle through rotating steering wheel. But I have some problems with it. I'm using SteamVR component "Circular Drive". This script returns "Out Angle" - angle of steering wheel rotation, and this rotation I implement to the cars rotation. Here is how my control script looks like:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR.InteractionSystem;
public class carMovement : MonoBehaviour {
//Getting SteamVR Circular Drive comptonent
public CircularDrive OutputDataFromSteeringWHeel;
void Update () {
//Moving forward
transform.position -= transform.up * Time.deltaTime;
// Implementing rotation from steering wheel to the car
transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, (OutputDataFromSteeringWHeel.outAngle * Time.deltaTime ));
}
}
But it seems to be using and adding cars rotation while it's turning. It's rotates steering wheel, when I don't do it.
Here what is happening: https://youtu.be/Q6X1VZa8iZw
Please help to resolve that stuff. Thank you!
Comment
Answer by Galaxxxy · Mar 11, 2018 at 12:09 AM
i have the same issue here , did you find any solution?