ZeusRum
Hectopat
Daha fazla
- Sistem Özellikleri
- İ5-4590 GT730 2GB 8GB RAM
- Cinsiyet
- Erkek
Kodu çalıştırmayı denediğimde CS1002 Expected hatası alıyorum.
Kod
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArabaKontrol : MonoBehaviour
{
public WheelCollider onSolCol;
public WheelCollider onSagCol;
public WheelCollider arkaSolCol;
public WheelCollider arkaSagCol;
public GameObject onSol;
public GameObject onSag;
public GameObject arkaSol;
public GameObject arkaSag;
public float maxMotorGucu;
public float maxDonusAcisi;
public float motor;
void Start()
{
}
void Update()
{
}
private void FixedUpdate()
{
motor = maxMotorGucu * Input.GetAxis("Vertical");
float donus = maxDonusAcisi * Input.GetAxis("Horizontal");
onSolCol.steerAngle = onSagCol.steerAngle = donus;
arkaSagCol.motorTorque = motor;
arkaSolCol.motorTorque = motor;
SanalTeker();
}
private void FixedUpdate()
}
void SanalTeker()
{
Quaternion rot;
Vector3 pos;
onSolCol.GetWorldPose(out pos, out rot);
onSol.transform.position = pos;
onSol.transform.position = rot;
Quaternion rot;
Vector3 pos;
onSagCol.GetWorldPose(out pos, out rot);
onSag.transform.position = pos;
onSag.transform.position = rot;
Quaternion rot;
Vector3 pos;
arkaSolCol.GetWorldPose(out pos, out rot);
arkaSol.transform.position = pos;
arkaSol.transform.position = rot;
Quaternion rot;
Vector3 pos;
arkaSagCol.GetWorldPose(out pos, out rot);
arkaSag.transform.position = pos;
arkaSag.transform.position = rot;
}
}
}
Kod
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArabaKontrol : MonoBehaviour
{
public WheelCollider onSolCol;
public WheelCollider onSagCol;
public WheelCollider arkaSolCol;
public WheelCollider arkaSagCol;
public GameObject onSol;
public GameObject onSag;
public GameObject arkaSol;
public GameObject arkaSag;
public float maxMotorGucu;
public float maxDonusAcisi;
public float motor;
void Start()
{
}
void Update()
{
}
private void FixedUpdate()
{
motor = maxMotorGucu * Input.GetAxis("Vertical");
float donus = maxDonusAcisi * Input.GetAxis("Horizontal");
onSolCol.steerAngle = onSagCol.steerAngle = donus;
arkaSagCol.motorTorque = motor;
arkaSolCol.motorTorque = motor;
SanalTeker();
}
private void FixedUpdate()
}
void SanalTeker()
{
Quaternion rot;
Vector3 pos;
onSolCol.GetWorldPose(out pos, out rot);
onSol.transform.position = pos;
onSol.transform.position = rot;
Quaternion rot;
Vector3 pos;
onSagCol.GetWorldPose(out pos, out rot);
onSag.transform.position = pos;
onSag.transform.position = rot;
Quaternion rot;
Vector3 pos;
arkaSolCol.GetWorldPose(out pos, out rot);
arkaSol.transform.position = pos;
arkaSol.transform.position = rot;
Quaternion rot;
Vector3 pos;
arkaSagCol.GetWorldPose(out pos, out rot);
arkaSag.transform.position = pos;
arkaSag.transform.position = rot;
}
}
}