Answered
0
0

https://www.youtube.com/watch?v=nnT2-ldNEHs&t=601s
The first part where I attach the event to the hellaphant animation event won’t play anything however I accidentally added the event to the hellaphants movement animation and it played but only in the middle of the map as if the listener were only where the game started.
The second part about called the emitter to play on the health script doesn’t work and instead gives won’t let enemies take damage at all giving me an error.

NullReferenceException: Object reference not set to an instance of an object CompleteProject.EnemyHealth.TakeDamage (Int32 amount, Vector3 hitPoint) (at Assets/_Complete- Game/Scripts/Enemy/EnemyHealth.cs:57) CompleteProject.PlayerShooting.Shoot () (at Assets/_Complete- Game/Scripts/Player/PlayerShooting.cs:108) CompleteProject.PlayerShooting.Update () (at Assets/_Complete-Game/Scripts/Player/PlayerShooting.cs:47)

This is driving me mad. Please help.

  • You must to post comments
Best Answer
0
0

The position of the sound is determined by the position of the GameObject that the script is attached to:

FMODUnity.RuntimeManage.PlayOneShot(path, GetComponent<Transform>().position);

Or the sound doesn’t have a 3D panner on it, making it 2D and audible everywhere.

The NullReferenceException doesn’t mention anything about FMOD.
It is saying one these objects are null/not assigned:

CompleteProject.EnemyHealth.TakeDamage()

If you can use break points to stop the code on this line, you should be able to hover over each name and it will tell you if it is valid or not.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.