Hello Unity Community,
my first Post, i hope i can explain my problem well.
I made a Video how i setup a StarShip and let it shoot, for this i use Large Blaster Assets.
Now i have problems with the Sound if i slow down my Ship i can hear the Sound good left and right.
But if i fly fast i just get ugly sounds.
here in this video you can see if the Ship is far away u have crazy sound (the ship is moving with 500 up to 1000) The shots should move around 2500 to 3000. The speed of the Ship is also various and can raise up to 1300 and also can be lower.
My only Solution is to fix the Camera Point in the center of my Ship to get clearly Sounds. But in this Arcade i want that the Camera zooming in and zooming out depending on Ships speed
Camera Script attachet to the Ship Parent Object:
using UnityEngine;
using System.Collections;
public class CameraMover : MonoBehaviour
{
Vector3 targetPosition;
public float distanceCheck = 30f;
public float angularCheck = 7f;
public float distanceBehind = 7f;
public float height = 4f;
void FixedUpdate()
{
targetPosition = transform.position - transform.forward * distanceBehind + transform.up * height;
if (Camera.main)
{
Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, targetPosition, Time.deltaTime * distanceCheck);
Camera.main.transform.localRotation = Quaternion.Slerp(Camera.main.transform.localRotation, transform.localRotation, Time.deltaTime * angularCheck);
}
}
}
in the Ship i call the Sounds with this Script
AudioSource.PlayClipAtPoint(sfxFire[_sfxRoundRobinFire], _b.muzzle.position, volumeFire);
but here i say already “PlayCipAtPoint” so he spawn the Sound File at the Position of the end of my Canonen (_b.muzzle.position) but nothing more so i fly with my Ship up to 1200 Units per second away from the Sounds.
i was thinking to add a Force to this so i attach a rigidbody to this and say the following lines of Code
PlayerController playerController;
Rigidbody rb;
private float thrust;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
thrust = PlayerController.shipSpeed;
}
// In the Fire Method
AudioSource.PlayClipAtPoint(sfxFire[_sfxRoundRobinFire], _b.muzzle.position, volumeFire);
rb.AddForce(transform.forward * thrust);
but not working xD, i hope someone can help my brain out to come behind this problem, looks like i have a barricade in front of me. Thanks
Edit:
i tried already to change the 3D Sound Settings, Doppler Level, Spread, Min and Max Distance
but whatever i setup theres a Sound Disoriantation when my Camera is behind the Ship.
When i go between the Weapons the Shot Audio called clearly