Search Unity

Collision magnitude based on angle and velocity

Discussion in 'Scripting' started by Mr_Mendel, Mar 2, 2014.

  1. Mr_Mendel

    Mr_Mendel

    Joined:
    Dec 31, 2013
    Posts:
    19
    Hi all,

    I am creating a golf like game and want to play a sound when the ball hits a wall or floor etc..

    I can get the relativemagnitude of the collision to alter the sound clip volume but this just means that when I clip a wall travelling fast it plays a loud sound.

    What I want is a relativemagnitude based on normals, at least I think I do. So if the ball is hit nearly vertically up but fast and brushes an object it doesn't make the loudest sound.

    Is there a way to do this I have searched for ages and keep coming up blank.

    Thanks in advance people.

    Mike