Hi! I’ am total beginner and i mostly copy and paste scripts to make things work ( also I’m french so sorry broken for the English).
I guess it’s really simple, i have a FPS character that can move objects,I need them to make a sound (like a Rolling ball sound for exemple) when I move them, pushing them… I tried to use a script that play sound on collision but the result is too weird.
Here is the script :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollisionSound : MonoBehaviour
{
//volume: 0..1
//Magnitude
private void OnCollisionStay(Collision collision)
{
GetComponent<AudioSource>().Play();
}
}
If someone as Something i’ll be really Gratefull !