now i get Non-invocable member 'Vector3' cannot be used like a method. Code (CSharp): void SprayDirection() { var vx = (1 - 2 * Random.value) * shotSpread; var vy = (1 - 2 * Random.value) * shotSpread; var vz = 1.0; return transform.TransformDirection(Vector3(vx, vy, vz)); }
Also you cant return Vector3(or anything else for that matter) on a void You should refer yourself to the learn section.
As I've said, you can't return anything on a void function, "void" says what the function returns, void is nothing, you want to replace the "void" with "Vector3" meaning that the function MUST return a Vector3. PLEASE, do yourself a favor and go study this stuff, you're jumping ahead of your knowledge and you gonna hit a major wall during development making you wanna quit because the game your dreaming about doesn't take form. https://unity3d.com/learn