Hello guys, usually I don’t ask question like this but I’m stuck and could not find any help. I have an enemy AI javascript code and I try to add it’s attack function to other C# code. I’m stuck in some place I don’t know how to write it in c# so I need help guys.
Js :
function Attack(){
var Hit : RaycastHit;
var direction = bulletAccuracy(); // I couldn't know how to write this in CS
// and raycast stuff that I think I can convert
}
function bulletAccuracy(){
var spX = (1 - 2 * Random.value) * bulletAccuracy; // and this
// other stuff that I can covert
}
I tried
RaycastHit Hit;
for that, and
Vector3 direction = bulletAccuracy();
but then I couldn’t know how to write function bulletAccuracy in js, if I try
void bulletAccuracy(){
}
and
IENumarator bulletAccuracy(){
}
I get errors, how can I write I need only these 2-3 lines guys sorry to ask a question like that but I have no choice.