Создаем файлик GunRecoil.js
Используется javascript
var baseInaccuracy : float = 0.1;
var inaccuracyIncreaseOverTime : float = 0.03;
var maximumInaccuracy : float = 1.0;
var triggerTime : float = 0.05;
function Update(){
// Did the user press fire?
if (Input.GetButton("Fire1")) {
// Fire();
// Slowly increase the inaccuracy of the gun while the user is firing and cap it at the maximum amount
triggerTime += inaccuracyIncreaseOverTime;
if (triggerTime >= maximumInaccuracy) {
triggerTime = maximumInaccuracy;
}
} else {
// If we stopped firing reduce the inaccuracy rather quickly and cap it at the base amount
triggerTime -= 0.2;
if (triggerTime <= baseInaccuracy) {
triggerTime = baseInaccuracy;
}
}
}
В принципе, достаточно было скопировать внутренности класса в скрипт и посмотреть на строчки с ошибками