This is the line of code that is causing the issue: this.entity.sound.slot(‘Slot 1’).pitch = Math.random()+0.5;
Can you help?
I’m trying to randomize the pitch of the laser, but when i run my game a error message pops up
Hi @Bradley_Pelletier! Make sure
this.entity is the entity with the sound component. If the entity with the script is not the entity with the sound component, you can not use
Another issue is that the update function of the InputHandler script is not closed correctly. There is missing
}; at the end of the script.
Thank you, I’ll try it out and let you know if it worked.